From 83339bf37291758a243a894db9418e989f0e0818 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 24 Jan 2025 06:18:28 +0100 Subject: [PATCH] add a regression test --- tests/crashes/128097.rs | 6 ------ tests/ui/explicit-tail-calls/two-phase.rs | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) delete mode 100644 tests/crashes/128097.rs create mode 100644 tests/ui/explicit-tail-calls/two-phase.rs diff --git a/tests/crashes/128097.rs b/tests/crashes/128097.rs deleted file mode 100644 index 6ffca640cbd..00000000000 --- a/tests/crashes/128097.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ known-bug: #128097 -#![feature(explicit_tail_calls)] -fn f(x: &mut ()) { - let _y: String; - become f(x); -} diff --git a/tests/ui/explicit-tail-calls/two-phase.rs b/tests/ui/explicit-tail-calls/two-phase.rs new file mode 100644 index 00000000000..91365b5e739 --- /dev/null +++ b/tests/ui/explicit-tail-calls/two-phase.rs @@ -0,0 +1,14 @@ +// regression test for . +// 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() {}