rust/src/librustc_error_codes/error_codes/E0633.md
Trevor Spiteri 534c3eaf28 error code examples: replace some more ignore with compile_fail
Now that compile_fail attempts a full build rather than
--emit=metadata, these errors should be caught by compile_fail and do
not need to be ignored.
2020-02-06 15:31:21 +01:00

696 B

The unwind attribute was malformed.

Erroneous code example:

#![feature(unwind_attributes)]

#[unwind()] // error: expected one argument
pub extern fn something() {}

fn main() {}

The #[unwind] attribute should be used as follows:

  • #[unwind(aborts)] -- specifies that if a non-Rust ABI function should abort the process if it attempts to unwind. This is the safer and preferred option.

  • #[unwind(allowed)] -- specifies that a non-Rust ABI function should be allowed to unwind. This can easily result in Undefined Behavior (UB), so be careful.

NB. The default behavior here is "allowed", but this is unspecified and likely to change in the future.