File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed
src/tools/clippy/tests/ui Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ fn main() {
3333 INT_MIN % NEG_ONE ;
3434 //~^ ERROR: this operation will panic at runtime
3535 //~| 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.
3737 INT_MIN % STATIC_NEG_ONE ;
38- //~^ ERROR: this operation will panic at runtime
3938}
Original file line number Diff line number Diff line change @@ -12,12 +12,6 @@ error: this operation will panic at runtime
1212LL | INT_MIN % NEG_ONE;
1313 | ^^^^^^^^^^^^^^^^^ attempt to compute `i64::MIN % -1_i64`, which would overflow
1414
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-
2115error: any number modulo 1 will be 0
2216 --> $DIR/modulo_one.rs:8:5
2317 |
@@ -57,5 +51,5 @@ error: any number modulo -1 will panic/overflow or result in 0
5751LL | INT_MIN % NEG_ONE;
5852 | ^^^^^^^^^^^^^^^^^
5953
60- error: aborting due to 9 previous errors
54+ error: aborting due to 8 previous errors
6155
You can’t perform that action at this time.
0 commit comments