Closed
Description
I would expect the following code to abort, and never print Hello
:
#![feature(unwind_attributes)]
#[unwind(aborts)]
fn foo() { // implicitly: extern "Rust"
panic!("foooo");
}
fn main() {
if let Err(_) = std::panic::catch_unwind(|| foo()) {}
println!("Hello");
}
But instead, the unwind
attribute is ignored.
Cc @gnzlbg
Activity
gnzlbg commentedon Aug 25, 2019
That looks like a bug. cc @eddyb @alexcrichton
eddyb commentedon Aug 26, 2019
extern "Rust" fn
is justfn
, and havingextern "Rust"
in the testcase may create the wrong impression (i.e. this bug has nothing to do with FFI).Still, the attribute should either work and cause an abort or error as unapplicable.
RalfJung commentedon Aug 26, 2019
I deliberately made it explicit, but sure, I can adjust the example.
alexcrichton commentedon Aug 26, 2019
Agreed that this just looks like a bug that needs to be fixed.
Rollup merge of rust-lang#65347 - RalfJung:unwind-abort-rust, r=varkor
Rollup merge of rust-lang#65347 - RalfJung:unwind-abort-rust, r=varkor