]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0633.md
Rollup merge of #62514 - stephaneyfx:box-ffi, r=nikomatsakis
[rust.git] / src / librustc_error_codes / error_codes / E0633.md
1 The `unwind` attribute was malformed.
2
3 Erroneous code example:
4
5 ```ignore (compile_fail not working here; see Issue #43707)
6 #[unwind()] // error: expected one argument
7 pub extern fn something() {}
8
9 fn main() {}
10 ```
11
12 The `#[unwind]` attribute should be used as follows:
13
14 - `#[unwind(aborts)]` -- specifies that if a non-Rust ABI function
15   should abort the process if it attempts to unwind. This is the safer
16   and preferred option.
17
18 - `#[unwind(allowed)]` -- specifies that a non-Rust ABI function
19   should be allowed to unwind. This can easily result in Undefined
20   Behavior (UB), so be careful.
21
22 NB. The default behavior here is "allowed", but this is unspecified
23 and likely to change in the future.