Files
rust/tests/ui/asm/non-const.rs
T
2026-02-28 11:39:26 -05:00

13 lines
283 B
Rust

//@ needs-asm-support
//@ reference: asm.operand-type.supported-operands.const
use std::arch::global_asm;
fn main() {}
// Constants must be... constant
fn non_const_fn(x: i32) -> i32 { x }
global_asm!("/* {} */", const non_const_fn(0));
//~^ERROR: cannot call non-const function