Static rustc_lint::builtin::UNSAFE_CODE

source ·
static UNSAFE_CODE: &Lint
Expand description

The unsafe_code lint catches usage of unsafe code and other potentially unsound constructs like no_mangle, export_name, and link_section.


fn main() {
    unsafe {


fn func_0() { }

#[export_name = "exported_symbol_name"]
pub fn name_in_rust() { }

#[link_section = ".example_section"]
pub static VAR1: u32 = 1;



This lint is intended to restrict the usage of unsafe blocks and other constructs (including, but not limited to no_mangle, link_section and export_name attributes) wrong usage of which causes undefined behavior.