Skip to content

Commit dbea5df

Browse files
Mark-Simulacrumcuviper
authored andcommitted
Permit unwinding through FFI by default
See #58794 for context.
1 parent 0ff088c commit dbea5df

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
@@ -604,7 +604,7 @@ fn should_abort_on_panic<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
604604
// This is a special case: some functions have a C abi but are meant to
605605
// unwind anyway. Don't stop them.
606606
match unwind_attr {
607-
None => true,
607+
None => false, // FIXME(#58794)
608608
Some(UnwindAttr::Allowed) => false,
609609
Some(UnwindAttr::Aborts) => true,
610610
}

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

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

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

0 commit comments

Comments
 (0)