Skip to content

Commit 5d3377d

Browse files
committed
Add regression test for OOM issue on EarlyLintPass ICE
1 parent 95978b3 commit 5d3377d

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// compile-flags: -Ztreat-err-as-bug
2+
// dont-check-failure-status
3+
// error-pattern: aborting due to `-Z treat-err-as-bug=1`
4+
// normalize-stderr-test "note: .*\n\n" -> ""
5+
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
6+
// rustc-env:RUST_BACKTRACE=0
7+
8+
fn main() {
9+
#[deny(while_true)]
10+
while true {}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error: denote infinite loops with `loop { ... }`
2+
--> $DIR/panic-causes-oom-112708.rs:10:5
3+
|
4+
LL | while true {}
5+
| ^^^^^^^^^^ help: use `loop`
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/panic-causes-oom-112708.rs:9:12
9+
|
10+
LL | #[deny(while_true)]
11+
| ^^^^^^^^^^
12+
13+
error: the compiler unexpectedly panicked. this is a bug.
14+
15+
query stack during panic:
16+
thread panicked while processing panic. aborting.

0 commit comments

Comments
 (0)