2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ fn main() {
33
33
INT_MIN % NEG_ONE ;
34
34
//~^ ERROR: this operation will panic at runtime
35
35
//~| ERROR: any number modulo -1 will panic/overflow or result in 0
36
- // ONLY caught by rustc
36
+ // Not caught by lint, we don't look into static items, even if entirely immutable.
37
37
INT_MIN % STATIC_NEG_ONE ;
38
- //~^ ERROR: this operation will panic at runtime
39
38
}
Original file line number Diff line number Diff line change @@ -12,12 +12,6 @@ error: this operation will panic at runtime
12
12
LL | INT_MIN % NEG_ONE;
13
13
| ^^^^^^^^^^^^^^^^^ attempt to compute `i64::MIN % -1_i64`, which would overflow
14
14
15
- error: this operation will panic at runtime
16
- --> $DIR/modulo_one.rs:37:5
17
- |
18
- LL | INT_MIN % STATIC_NEG_ONE;
19
- | ^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i64::MIN % -1_i64`, which would overflow
20
-
21
15
error: any number modulo 1 will be 0
22
16
--> $DIR/modulo_one.rs:8:5
23
17
|
@@ -57,5 +51,5 @@ error: any number modulo -1 will panic/overflow or result in 0
57
51
LL | INT_MIN % NEG_ONE;
58
52
| ^^^^^^^^^^^^^^^^^
59
53
60
- error: aborting due to 9 previous errors
54
+ error: aborting due to 8 previous errors
61
55
0 commit comments