identity_op lint fix for '&' with unsigned types

This commit is contained in:
Yury Krivopalov 2017-09-30 11:33:15 +03:00
parent f0aa2c1587
commit f68e408cb6
3 changed files with 28 additions and 6 deletions

View file

@ -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;
}

View file

@ -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;
| ^^^^^^^