Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0b6cf3b

Browse files
committedJan 23, 2024
We don't look into static items anymore during const prop
1 parent 6b359b7 commit 0b6cf3b

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed
 

Diff for: ‎tests/ui/modulo_one.rs

+1-2
Original file line numberDiff line numberDiff 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
}

Diff for: ‎tests/ui/modulo_one.stderr

+1-7
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ error: this operation will panic at runtime
1212
LL | 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-
2115
error: 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
5751
LL | INT_MIN % NEG_ONE;
5852
| ^^^^^^^^^^^^^^^^^
5953

60-
error: aborting due to 9 previous errors
54+
error: aborting due to 8 previous errors
6155

0 commit comments

Comments
 (0)
Failed to load comments.