identity_op lint fix for '&' with unsigned types
This commit is contained in:
parent
f0aa2c1587
commit
f68e408cb6
3 changed files with 28 additions and 6 deletions
|
|
@ -27,4 +27,7 @@ fn main() {
|
|||
|
||||
x & NEG_ONE; //no error, as we skip lookups (for now)
|
||||
-1 & x;
|
||||
|
||||
let u : u8 = 0;
|
||||
u & 255;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,3 +42,9 @@ error: the operation is ineffective. Consider reducing it to `x`
|
|||
29 | -1 & x;
|
||||
| ^^^^^^
|
||||
|
||||
error: the operation is ineffective. Consider reducing it to `u`
|
||||
--> $DIR/identity_op.rs:32:5
|
||||
|
|
||||
32 | u & 255;
|
||||
| ^^^^^^^
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue