Skip to content

Commit 39412ca

Browse files
Mark-Simulacrumcuviper
authored andcommitted
Permit unwinding through FFI by default
See rust-lang#58794 for context.
1 parent d760df5 commit 39412ca

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/librustc_mir/build/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ fn should_abort_on_panic(tcx: TyCtxt<'_>, fn_def_id: DefId, abi: Abi) -> bool {
502502
// This is a special case: some functions have a C abi but are meant to
503503
// unwind anyway. Don't stop them.
504504
match unwind_attr {
505-
None => true,
505+
None => false, // FIXME(#58794)
506506
Some(UnwindAttr::Allowed) => false,
507507
Some(UnwindAttr::Aborts) => true,
508508
}

src/test/ui/abi/abort-on-c-abi.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22

33
#![allow(unused_must_use)]
4+
#![feature(unwind_attributes)]
45
// Since we mark some ABIs as "nounwind" to LLVM, we must make sure that
56
// we never unwind through them.
67

@@ -13,6 +14,7 @@ use std::io::prelude::*;
1314
use std::io;
1415
use std::process::{Command, Stdio};
1516

17+
#[unwind(aborts)] // FIXME(#58794)
1618
extern "C" fn panic_in_ffi() {
1719
panic!("Test");
1820
}

0 commit comments

Comments
 (0)