rust/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.rs
2024-02-20 00:14:53 +01:00

21 lines
370 B
Rust

//@ needs-asm-support
#![deny(unsafe_code)]
use std::arch::global_asm;
#[allow(unsafe_code)]
mod allowed_unsafe {
std::arch::global_asm!("");
}
macro_rules! unsafe_in_macro {
() => {
global_asm!(""); //~ ERROR: usage of `core::arch::global_asm`
};
}
global_asm!(""); //~ ERROR: usage of `core::arch::global_asm`
unsafe_in_macro!();
fn main() {}