diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2018-11-15 06:17:58 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2018-12-12 08:07:28 -0800 |
| commit | 1091eee65b91a9968f2a0b2f0c7d6e8e27d8d033 (patch) | |
| tree | a39396a99d4ec12f53c2a622854bdb993d5b48eb /src/test/codegen | |
| parent | bd47d6825bf4090517549d33cfef10d3300b4a75 (diff) | |
| download | rust-1091eee65b91a9968f2a0b2f0c7d6e8e27d8d033.tar.gz rust-1091eee65b91a9968f2a0b2f0c7d6e8e27d8d033.zip | |
rustc: Switch `extern` functions to abort by default on panic
This was intended to land way back in 1.24, but it was backed out due to breakage which has long since been fixed. An unstable `#[unwind]` attribute can be used to tweak the behavior here, but this is currently simply switching rustc's internal default to abort-by-default if an `extern` function panics, making our codegen sound primarily (as currently you can produce UB with safe code) Closes #52652
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/nounwind-extern.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/codegen/nounwind-extern.rs b/src/test/codegen/nounwind-extern.rs new file mode 100644 index 00000000000..ed07cf1d6b2 --- /dev/null +++ b/src/test/codegen/nounwind-extern.rs @@ -0,0 +1,16 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -O + +#![crate_type = "lib"] + +// CHECK: Function Attrs: norecurse nounwind +pub extern fn foo() {} |
