diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-02-20 13:49:54 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-02-20 19:12:52 -0500 |
| commit | a47fd3df89c267829d96748b3bdff305f20d27d5 (patch) | |
| tree | 676d0df0845297a873c5e0a6620f464dea49a642 /src/libstd | |
| parent | 27a046e9338fb0455c33b13e8fe28da78212dedc (diff) | |
| download | rust-a47fd3df89c267829d96748b3bdff305f20d27d5.tar.gz rust-a47fd3df89c267829d96748b3bdff305f20d27d5.zip | |
make `#[unwind]` attribute specify expectations more clearly
You can now choose between the following: - `#[unwind(allowed)]` - `#[unwind(aborts)]` Per rust-lang/rust#48251, the default is `#[unwind(allowed)]`, though I think we should change this eventually.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/panicking.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs index 161c3fc7113..454ac64735c 100644 --- a/src/libstd/panicking.rs +++ b/src/libstd/panicking.rs @@ -55,7 +55,8 @@ extern { data: *mut u8, data_ptr: *mut usize, vtable_ptr: *mut usize) -> u32; - #[unwind] + #[cfg_attr(stage0, unwind)] + #[cfg_attr(not(stage0), unwind(allowed))] fn __rust_start_panic(data: usize, vtable: usize) -> u32; } @@ -315,7 +316,8 @@ pub fn panicking() -> bool { /// Entry point of panic from the libcore crate. #[cfg(not(test))] #[lang = "panic_fmt"] -#[unwind] +#[cfg_attr(stage0, unwind)] +#[cfg_attr(not(stage0), unwind(allowed))] pub extern fn rust_begin_panic(msg: fmt::Arguments, file: &'static str, line: u32, |
