Skip to content

Commit

Permalink
Remove unrelated lints from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cgm616 committed Oct 22, 2020
1 parent 03ca52e commit 56e6588
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
1 change: 1 addition & 0 deletions tests/ui/xor_used_as_pow.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-rustfix
#![warn(clippy::xor_used_as_pow)]
#![allow(clippy::identity_op)]

// Should not be linted
#[allow(dead_code)]
Expand Down
1 change: 1 addition & 0 deletions tests/ui/xor_used_as_pow.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-rustfix
#![warn(clippy::xor_used_as_pow)]
#![allow(clippy::identity_op)]

// Should not be linted
#[allow(dead_code)]
Expand Down
30 changes: 8 additions & 22 deletions tests/ui/xor_used_as_pow.stderr
Original file line number Diff line number Diff line change
@@ -1,66 +1,52 @@
error: it appears you are trying to get a power of two, but `^` is not an exponentiation operator
--> $DIR/xor_used_as_pow.rs:23:13
--> $DIR/xor_used_as_pow.rs:24: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: `^` is not an exponentiation operator but appears to have been used as one
--> $DIR/xor_used_as_pow.rs:24:13
--> $DIR/xor_used_as_pow.rs:25:13
|
LL | let _ = 10 ^ 4;
| ^^^^^^
|
= help: did you mean to use .pow()?

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.rs:26:13
|
LL | let _ = 2 ^ 32;
| ^^^^^^ help: use a bitshift or constant instead: `1_u64 << 32`

error: the operation is ineffective. Consider reducing it to `2`
--> $DIR/xor_used_as_pow.rs:26:13
|
LL | let _ = 2 ^ 0;
| ^^^^^
|
= note: `-D clippy::identity-op` 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.rs:27:13
|
LL | let _ = 2 ^ 0;
| ^^^^^ help: use a bitshift or constant instead: `1`

error: the operation is ineffective. Consider reducing it to `10`
--> $DIR/xor_used_as_pow.rs:27:13
|
LL | let _ = 10 ^ 0;
| ^^^^^^

error: `^` is not an exponentiation operator but appears to have been used as one
--> $DIR/xor_used_as_pow.rs:27:13
--> $DIR/xor_used_as_pow.rs:28:13
|
LL | let _ = 10 ^ 0;
| ^^^^^^
|
= help: did you mean to use .pow()?

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

error: `^` is not an exponentiation operator but appears to have been used as one
--> $DIR/xor_used_as_pow.rs:31:17
--> $DIR/xor_used_as_pow.rs:32:17
|
LL | let _ = 10 ^ x;
| ^^^^^^
|
= help: did you mean to use .pow()?

error: aborting due to 9 previous errors
error: aborting due to 7 previous errors

0 comments on commit 56e6588

Please sign in to comment.