Skip to content

Commit db80405

Browse files
committed
Add test for ICE-125323
Signed-off-by: Shunpoco <[email protected]>
1 parent 3cf7d22 commit db80405

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Issue-125323
2+
fn main() {
3+
for _ in 0..0 { //~ ERROR type annotations needed [E0282]
4+
[(); loop {}]; //~ ERROR constant evaluation is taking a long time
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
error: constant evaluation is taking a long time
2+
--> $DIR/do-not-ice-long-constant-evaluation-in-for-loop.rs:4:14
3+
|
4+
LL | [(); loop {}];
5+
| ^^^^^^^
6+
|
7+
= note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
8+
If your compilation actually takes a long time, you can safely allow the lint.
9+
help: the constant being evaluated
10+
--> $DIR/do-not-ice-long-constant-evaluation-in-for-loop.rs:4:14
11+
|
12+
LL | [(); loop {}];
13+
| ^^^^^^^
14+
= note: `#[deny(long_running_const_eval)]` on by default
15+
16+
error[E0282]: type annotations needed
17+
--> $DIR/do-not-ice-long-constant-evaluation-in-for-loop.rs:3:14
18+
|
19+
LL | for _ in 0..0 {
20+
| ^^^^ cannot infer type for struct `std::ops::Range<{integer}>`
21+
22+
error: aborting due to 2 previous errors
23+
24+
For more information about this error, try `rustc --explain E0282`.

0 commit comments

Comments
 (0)