2021-10-27 18:37:18 +01:00
|
|
|
// only-x86_64
|
|
|
|
|
2021-12-10 00:15:33 +00:00
|
|
|
use std::arch::asm;
|
2021-10-27 18:37:18 +01:00
|
|
|
|
2022-05-10 22:02:37 +01:00
|
|
|
unsafe fn foo<const N: usize>() {
|
|
|
|
asm!("mov eax, {}", const N + 1);
|
|
|
|
//~^ ERROR const operands for inline assembly are unstable
|
|
|
|
}
|
|
|
|
|
2021-10-27 18:37:18 +01:00
|
|
|
fn main() {
|
|
|
|
unsafe {
|
2022-05-10 22:02:37 +01:00
|
|
|
foo::<0>();
|
2021-10-27 18:37:18 +01:00
|
|
|
asm!("mov eax, {}", const 123);
|
|
|
|
//~^ ERROR const operands for inline assembly are unstable
|
|
|
|
}
|
|
|
|
}
|