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