]> git.lizzy.rs Git - rust.git/commitdiff
Permit unwinding through FFI by default
authorMark Rousskov <mark.simulacrum@gmail.com>
Thu, 28 Feb 2019 00:21:31 +0000 (17:21 -0700)
committerJosh Stone <jistone@redhat.com>
Sun, 25 Aug 2019 16:47:50 +0000 (09:47 -0700)
See #58794 for context.

src/librustc_mir/build/mod.rs
src/test/ui/abi/abort-on-c-abi.rs

index 4e970aee42cf47ca9b077d50791941005c19fdf7..6a3bb8b8b86a2632744c00b6dd4b89547996b8f4 100644 (file)
@@ -502,7 +502,7 @@ fn should_abort_on_panic(tcx: TyCtxt<'_>, fn_def_id: DefId, abi: Abi) -> bool {
     // This is a special case: some functions have a C abi but are meant to
     // unwind anyway. Don't stop them.
     match unwind_attr {
     // This is a special case: some functions have a C abi but are meant to
     // unwind anyway. Don't stop them.
     match unwind_attr {
-        None => true,
+        None => false, // FIXME(#58794)
         Some(UnwindAttr::Allowed) => false,
         Some(UnwindAttr::Aborts) => true,
     }
         Some(UnwindAttr::Allowed) => false,
         Some(UnwindAttr::Aborts) => true,
     }
index cd7dd1b6a452fdc5d50e18820278bc08061a457e..2f08730ec6132e301c4f36c6448d398dc61daa77 100644 (file)
@@ -1,6 +1,7 @@
 // run-pass
 
 #![allow(unused_must_use)]
 // run-pass
 
 #![allow(unused_must_use)]
+#![feature(unwind_attributes)]
 // Since we mark some ABIs as "nounwind" to LLVM, we must make sure that
 // we never unwind through them.
 
 // Since we mark some ABIs as "nounwind" to LLVM, we must make sure that
 // we never unwind through them.
 
@@ -13,6 +14,7 @@
 use std::io;
 use std::process::{Command, Stdio};
 
 use std::io;
 use std::process::{Command, Stdio};
 
+#[unwind(aborts)] // FIXME(#58794)
 extern "C" fn panic_in_ffi() {
     panic!("Test");
 }
 extern "C" fn panic_in_ffi() {
     panic!("Test");
 }