rust/tests/ui/asm/const-error.rs
2024-09-29 08:49:37 +02:00

18 lines
344 B
Rust

//@ only-x86_64
//@ needs-asm-support
//@ check-pass
// Test to make sure that we emit const errors late for inline asm,
// which is consistent with inline const blocks.
use std::arch::asm;
fn test<T>() {
unsafe {
// No error here, as this does not get monomorphized.
asm!("/* {} */", const 1 / 0);
}
}
fn main() {}