File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -18,25 +18,29 @@ impl std::ops::Neg for S {
18
18
19
19
const _MAX: usize = -1 ;
20
20
//~^ ERROR unary negation of unsigned integer
21
- //~| HELP use a cast or the `!` operator
21
+ //~| HELP try using a cast or the `!` operator
22
22
23
23
fn main ( ) {
24
24
let a = -1 ;
25
25
//~^ ERROR unary negation of unsigned integer
26
- //~| HELP use a cast or the `!` operator
26
+ //~| HELP try using a cast or the `!` operator
27
+ //~| SUGGESTION let a = !1;
27
28
let _b : u8 = a; // for infering variable a to u8.
28
29
29
30
-a;
30
31
//~^ ERROR unary negation of unsigned integer
31
- //~| HELP use a cast or the `!` operator
32
+ //~| HELP try using a cast or the `!` operator
33
+ //~| SUGGESTION !a
32
34
33
35
let _d = -1u8 ;
34
36
//~^ ERROR unary negation of unsigned integer
35
- //~| HELP use a cast or the `!` operator
37
+ //~| HELP try using a cast or the `!` operator
38
+ //~| SUGGESTION let _d = !1u8;
36
39
37
40
for _ in -10 ..10u8 { }
38
41
//~^ ERROR unary negation of unsigned integer
39
- //~| HELP use a cast or the `!` operator
42
+ //~| HELP try using a cast or the `!` operator
43
+ //~| SUGGESTION for _ in !10..10u8 {}
40
44
41
45
-S ; // should not trigger the gate; issue 26840
42
46
}
You can’t perform that action at this time.
0 commit comments