Skip to content

Commit 4a9a568

Browse files
committed
fix test
1 parent ffb670c commit 4a9a568

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/test/compile-fail/feature-gate-negate-unsigned.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,29 @@ impl std::ops::Neg for S {
1818

1919
const _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

2323
fn 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
}

0 commit comments

Comments
 (0)