Static rustc_ap_rustc_lint_defs::builtin::UNSUPPORTED_NAKED_FUNCTIONS[][src]

pub static UNSUPPORTED_NAKED_FUNCTIONS: &Lint
Expand description

The unsupported_naked_functions lint detects naked function definitions that are unsupported but were previously accepted.

Example

#![feature(naked_functions)]

#[naked]
pub fn f() -> u32 {
    42
}

{{produces}}

Explanation

The naked functions must be defined using a single inline assembly block.

The execution must never fall through past the end of the assembly code so the block must use noreturn option. The asm block can also use att_syntax option, but other options are not allowed.

The asm block must not contain any operands other than const and sym. Additionally, naked function should specify a non-Rust ABI.

While other definitions of naked functions were previously accepted, they are unsupported and might not work reliably. This is a future-incompatible lint that will transition into hard error in the future.