rust/tests/ui/asm/non-const.rs

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

12 lines
220 B
Rust
Raw Normal View History

//@ needs-asm-support
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 fn