rust/tests/ui/feature-gates/feature-gate-asm_const.rs

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

17 lines
335 B
Rust
Raw Normal View History

// only-x86_64
use std::arch::asm;
unsafe fn foo<const N: usize>() {
asm!("mov eax, {}", const N + 1);
//~^ ERROR const operands for inline assembly are unstable
}
fn main() {
unsafe {
foo::<0>();
asm!("mov eax, {}", const 123);
//~^ ERROR const operands for inline assembly are unstable
}
}