Skip to content

Commit 095f8e8

Browse files
Mark-Simulacrumcuviper
authored andcommitted
Permit unwinding through FFI by default
See #58794 for context.
1 parent 74e5a0d commit 095f8e8

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
@@ -502,7 +502,7 @@ fn should_abort_on_panic<'tcx>(tcx: TyCtxt<'tcx>, fn_def_id: DefId, abi: Abi) ->
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/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)