Skip to content

Commit

Permalink
Add regression test for OOM issue on EarlyLintPass ICE
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Jun 27, 2023
1 parent 95978b3 commit 5d3377d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/ui/treat-err-as-bug/panic-causes-oom-112708.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// compile-flags: -Ztreat-err-as-bug
// dont-check-failure-status
// error-pattern: aborting due to `-Z treat-err-as-bug=1`
// normalize-stderr-test "note: .*\n\n" -> ""
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
// rustc-env:RUST_BACKTRACE=0

fn main() {
#[deny(while_true)]
while true {}
}
16 changes: 16 additions & 0 deletions tests/ui/treat-err-as-bug/panic-causes-oom-112708.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
error: denote infinite loops with `loop { ... }`
--> $DIR/panic-causes-oom-112708.rs:10:5
|
LL | while true {}
| ^^^^^^^^^^ help: use `loop`
|
note: the lint level is defined here
--> $DIR/panic-causes-oom-112708.rs:9:12
|
LL | #[deny(while_true)]
| ^^^^^^^^^^

error: the compiler unexpectedly panicked. this is a bug.

query stack during panic:
thread panicked while processing panic. aborting.

0 comments on commit 5d3377d

Please sign in to comment.