rust/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
370 B
Rust
Raw Normal View History

//@ 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() {}