From b4618f9996b21b7fe8be14eb1697fa6364fcea8b Mon Sep 17 00:00:00 2001 From: cgm616 Date: Thu, 22 Oct 2020 18:31:11 -0400 Subject: [PATCH] Fix failing tests --- clippy_lints/src/xor_used_as_pow.rs | 2 +- tests/ui/xor_used_as_pow.stderr | 2 +- tests/ui/xor_used_as_pow_fixable.stderr | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/clippy_lints/src/xor_used_as_pow.rs b/clippy_lints/src/xor_used_as_pow.rs index ac5b9bdae5d3..3518e81dd636 100644 --- a/clippy_lints/src/xor_used_as_pow.rs +++ b/clippy_lints/src/xor_used_as_pow.rs @@ -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) => { diff --git a/tests/ui/xor_used_as_pow.stderr b/tests/ui/xor_used_as_pow.stderr index b3328ad8217d..77e7bc1221ac 100644 --- a/tests/ui/xor_used_as_pow.stderr +++ b/tests/ui/xor_used_as_pow.stderr @@ -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 diff --git a/tests/ui/xor_used_as_pow_fixable.stderr b/tests/ui/xor_used_as_pow_fixable.stderr index 1da6e47e1592..64a612d7a72c 100644 --- a/tests/ui/xor_used_as_pow_fixable.stderr +++ b/tests/ui/xor_used_as_pow_fixable.stderr @@ -1,5 +1,5 @@ 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` @@ -7,13 +7,13 @@ LL | let _ = 2 ^ 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`