-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.Category: This is a bug.F-asm`#![feature(asm)]` (not `llvm_asm`)`#![feature(asm)]` (not `llvm_asm`)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Metadata
Metadata
Assignees
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.Category: This is a bug.F-asm`#![feature(asm)]` (not `llvm_asm`)`#![feature(asm)]` (not `llvm_asm`)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.