Update to latest rustc diagnostic output
This commit is contained in:
parent
6bdb597a9f
commit
19a9441f85
@ -10,7 +10,7 @@ error: bit mask could be simplified with a call to `trailing_zeros`
|
||||
--> bit_masks.rs:12:5
|
||||
|
|
||||
12 | x & 0 == 0;
|
||||
| ^^^^^^^^^^ help: try `x.trailing_zeros() > 0`
|
||||
| ^^^^^^^^^^ help: try: `x.trailing_zeros() > 0`
|
||||
|
|
||||
= note: `-D verbose-bit-mask` implied by `-D warnings`
|
||||
|
||||
@ -18,7 +18,7 @@ error: bit mask could be simplified with a call to `trailing_zeros`
|
||||
--> bit_masks.rs:14:5
|
||||
|
|
||||
14 | x & 1 == 0; //ok, compared with zero
|
||||
| ^^^^^^^^^^ help: try `x.trailing_zeros() > 1`
|
||||
| ^^^^^^^^^^ help: try: `x.trailing_zeros() > 1`
|
||||
|
||||
error: incompatible bit mask: `_ & 2` can never be equal to `1`
|
||||
--> bit_masks.rs:15:5
|
||||
|
@ -5,6 +5,6 @@
|
||||
fn main() {
|
||||
let x: i32 = 42;
|
||||
let _ = #[clippy(author)] (x & 0b1111 == 0); // suggest trailing_zeros
|
||||
let _ = x & 0b11111 == 0; // suggest trailing_zeros
|
||||
let _ = x & 0b11010 == 0; // do not lint
|
||||
let _ = x & 0b1_1111 == 0; // suggest trailing_zeros
|
||||
let _ = x & 0b1_1010 == 0; // do not lint
|
||||
}
|
||||
|
@ -2,15 +2,15 @@ error: bit mask could be simplified with a call to `trailing_zeros`
|
||||
--> trailing_zeros.rs:7:31
|
||||
|
|
||||
7 | let _ = #[clippy(author)] (x & 0b1111 == 0); // suggest trailing_zeros
|
||||
| ^^^^^^^^^^^^^^^^^ help: try `x.trailing_zeros() > 4`
|
||||
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() > 4`
|
||||
|
|
||||
= note: `-D verbose-bit-mask` implied by `-D warnings`
|
||||
|
||||
error: bit mask could be simplified with a call to `trailing_zeros`
|
||||
--> trailing_zeros.rs:8:13
|
||||
|
|
||||
8 | let _ = x & 0b11111 == 0; // suggest trailing_zeros
|
||||
| ^^^^^^^^^^^^^^^^ help: try `x.trailing_zeros() > 5`
|
||||
8 | let _ = x & 0b1_1111 == 0; // suggest trailing_zeros
|
||||
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() > 5`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user