FFI_UNWIND_CALLS in rustc_lint::builtin - Rust
Description: The `ffi_unwind_calls` lint detects calls to foreign functions or function pointers with `C-unwind` or other FFI-unwind ABIs.

Skip to main content

## FFI_UNWIND_CALLS

# Static FFI_UNWIND_CALLS

Source

    pub static FFI_UNWIND_CALLS: &'static Lint

Expand description

The `ffi_unwind_calls` lint detects calls to foreign functions or function pointers with `C-unwind` or other FFI-unwind ABIs.

#### §Example

    #![warn(ffi_unwind_calls)]

    unsafe extern "C-unwind" {
        fn foo();
    }

    fn bar() {
        unsafe { foo(); }
        let ptr: unsafe extern "C-unwind" fn() = foo;
        unsafe { ptr(); }
    }

{{produces}}

#### §Explanation

For crates containing such calls, if they are compiled with `-C panic=unwind` then the produced library cannot be linked with crates compiled with `-C panic=abort`. For crates that desire this ability it is therefore necessary to avoid such calls.