add a regression test

This commit is contained in:
Waffle Lapkin 2025-01-24 06:18:28 +01:00
parent af2ce8b702
commit 83339bf372
No known key found for this signature in database
2 changed files with 14 additions and 6 deletions

View File

@ -1,6 +0,0 @@
//@ known-bug: #128097
#![feature(explicit_tail_calls)]
fn f(x: &mut ()) {
let _y: String;
become f(x);
}

View File

@ -0,0 +1,14 @@
// regression test for <https://github.com/rust-lang/rust/issues/112788>.
// this test used to ICE because we tried to run drop glue of `x`
// if dropping `_y` (happening at the `become` site) panicked and caused an unwind.
//
//@ check-pass
#![expect(incomplete_features)]
#![feature(explicit_tail_calls)]
fn f(x: &mut ()) {
let _y = String::new();
become f(x);
}
fn main() {}