File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 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 {
1818
1919const _MAX: usize = -1 ;
2020//~^ ERROR unary negation of unsigned integer
21- //~| HELP use a cast or the `!` operator
21+ //~| HELP try using a cast or the `!` operator
2222
2323fn main ( ) {
2424 let a = -1 ;
2525 //~^ 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;
2728 let _b : u8 = a; // for infering variable a to u8.
2829
2930 -a;
3031 //~^ 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
3234
3335 let _d = -1u8 ;
3436 //~^ 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;
3639
3740 for _ in -10 ..10u8 { }
3841 //~^ 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 {}
4044
4145 -S ; // should not trigger the gate; issue 26840
4246}
You can’t perform that action at this time.
0 commit comments