Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cgm616 committed Oct 22, 2020
1 parent 05fe342 commit b4618f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/xor_used_as_pow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl LateLintPass<'_> for XorUsedAsPow {
if let ExprKind::Binary(op, left, right) = &expr.kind;
if BinOpKind::BitXor == op.node;
if let ExprKind::Lit(lhs) = &left.kind;
if let Some((lhs_val, lhs_type)) = unwrap_dec_int_literal(cx, lhs);
if let Some((lhs_val, _)) = unwrap_dec_int_literal(cx, lhs);
then {
match &right.kind {
ExprKind::Lit(rhs) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/xor_used_as_pow.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: `^` is not an exponentiation operator but appears to have been used as on
LL | let _ = 10 ^ 4;
| ^^^^^^
|
= help: did you mean to use .pow()?
= note: `-D clippy::xor-used-as-pow` implied by `-D warnings`
= help: did you mean to use .pow()?

error: `^` is not an exponentiation operator but appears to have been used as one
--> $DIR/xor_used_as_pow.rs:27:17
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/xor_used_as_pow_fixable.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error: it appears you are trying to get a power of two, but `^` is not an exponentiation operator
--> $DIR/xor_used_as_pow.rs:25:13
--> $DIR/xor_used_as_pow_fixable.rs:25:13
|
LL | let _ = 2 ^ 3;
| ^^^^^ help: use a bitshift or constant instead: `1_u32 << 3`
|
= note: `-D clippy::xor-used-as-pow` implied by `-D warnings`

error: it appears you are trying to get a power of two, but `^` is not an exponentiation operator
--> $DIR/xor_used_as_pow.rs:26:13
--> $DIR/xor_used_as_pow_fixable.rs:26:13
|
LL | let _ = 2 ^ 32;
| ^^^^^^ help: use a bitshift or constant instead: `1_u64 << 32`

error: it appears you are trying to get a power of two, but `^` is not an exponentiation operator
--> $DIR/xor_used_as_pow.rs:29:17
--> $DIR/xor_used_as_pow_fixable.rs:29:17
|
LL | let _ = 2 ^ x;
| ^^^^^ help: use a bitshift or constant instead: `1 << x`
Expand Down

0 comments on commit b4618f9

Please sign in to comment.