diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-02-27 17:21:31 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2019-04-02 12:22:13 -0700 |
| commit | bca359141573ae80ff063cf5ce548db99d68be55 (patch) | |
| tree | d3102a653cde40fd962f229cc704ab2601c174ef /src | |
| parent | 88acdb53c52cf9d3b6a2be5252e320ef443838a6 (diff) | |
| download | rust-bca359141573ae80ff063cf5ce548db99d68be55.tar.gz rust-bca359141573ae80ff063cf5ce548db99d68be55.zip | |
Permit unwinding through FFI by default
See #58794 for context.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/build/mod.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/abort-on-c-abi.rs | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_mir/build/mod.rs b/src/librustc_mir/build/mod.rs index 903c8f8657f..942faaaeb97 100644 --- a/src/librustc_mir/build/mod.rs +++ b/src/librustc_mir/build/mod.rs @@ -591,7 +591,7 @@ fn should_abort_on_panic<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>, // unwind anyway. Don't stop them. let attrs = &tcx.get_attrs(fn_def_id); match attr::find_unwind_attr(Some(tcx.sess.diagnostic()), attrs) { - None => true, + None => false, // FIXME(#58794) Some(UnwindAttr::Allowed) => false, Some(UnwindAttr::Aborts) => true, } diff --git a/src/test/run-pass/abort-on-c-abi.rs b/src/test/run-pass/abort-on-c-abi.rs index df94cd57186..c3991bd2e59 100644 --- a/src/test/run-pass/abort-on-c-abi.rs +++ b/src/test/run-pass/abort-on-c-abi.rs @@ -1,4 +1,5 @@ #![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. @@ -10,6 +11,7 @@ use std::io::prelude::*; use std::io; use std::process::{Command, Stdio}; +#[unwind(aborts)] // FIXME(#58794) extern "C" fn panic_in_ffi() { panic!("Test"); } |
