Skip to content

Commit bca3591

Browse files
Mark-Simulacrumcuviper
authored andcommitted
Permit unwinding through FFI by default
See #58794 for context.
1 parent 88acdb5 commit bca3591

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/librustc_mir/build/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ fn should_abort_on_panic<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
591591
// unwind anyway. Don't stop them.
592592
let attrs = &tcx.get_attrs(fn_def_id);
593593
match attr::find_unwind_attr(Some(tcx.sess.diagnostic()), attrs) {
594-
None => true,
594+
None => false, // FIXME(#58794)
595595
Some(UnwindAttr::Allowed) => false,
596596
Some(UnwindAttr::Aborts) => true,
597597
}

src/test/run-pass/abort-on-c-abi.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![allow(unused_must_use)]
2+
#![feature(unwind_attributes)]
23
// Since we mark some ABIs as "nounwind" to LLVM, we must make sure that
34
// we never unwind through them.
45

@@ -10,6 +11,7 @@ use std::io::prelude::*;
1011
use std::io;
1112
use std::process::{Command, Stdio};
1213

14+
#[unwind(aborts)] // FIXME(#58794)
1315
extern "C" fn panic_in_ffi() {
1416
panic!("Test");
1517
}

0 commit comments

Comments
 (0)