pub static UNDEFINED_NAKED_FUNCTION_ABI: &Lint
Expand description

The undefined_naked_function_abi lint detects naked function definitions that either do not specify an ABI or specify the Rust ABI.

§Example

#![feature(asm_experimental_arch, naked_functions)]

use std::arch::asm;

#[naked]
pub fn default_abi() -> u32 {
    unsafe { asm!("", options(noreturn)); }
}

#[naked]
pub extern "Rust" fn rust_abi() -> u32 {
    unsafe { asm!("", options(noreturn)); }
}

{{produces}}

§Explanation

The Rust ABI is currently undefined. Therefore, naked functions should specify a non-Rust ABI.