Add regression test for OOM issue on EarlyLintPass ICE

This commit is contained in:
Philipp Krones 2023-06-21 20:05:15 +02:00
parent 95978b302c
commit 5d3377dd67
No known key found for this signature in database
GPG Key ID: 1CA0DF2AF59D68A5
2 changed files with 27 additions and 0 deletions

View File

@ -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 {}
}

View File

@ -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.