Closed
Description
I tried this code:
#![feature(asm)]
fn main() {
// errors if the following line is uncommented
// foo()
}
pub fn foo() {
unsafe {
asm!("xchgfoobarbaz bx, bx");
}
}
I expected to see this happen: Compilation error because xchgfoobarbaz
is not a valid assembly instruction.
Instead, this happened: The code compiles without errors or warnings. A compile error only occurs if the foo()
call is uncommented in main
.
Meta
Nightly version on playground: 2020-12-22 bb1fbbf
Originally reported by @tomaka in rust-osdev/x86_64#218.