mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-16 05:56:56 +00:00
add a regression test
This commit is contained in:
parent
af2ce8b702
commit
83339bf372
@ -1,6 +0,0 @@
|
||||
//@ known-bug: #128097
|
||||
#![feature(explicit_tail_calls)]
|
||||
fn f(x: &mut ()) {
|
||||
let _y: String;
|
||||
become f(x);
|
||||
}
|
14
tests/ui/explicit-tail-calls/two-phase.rs
Normal file
14
tests/ui/explicit-tail-calls/two-phase.rs
Normal 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() {}
|
Loading…
Reference in New Issue
Block a user