mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
12 lines
220 B
Rust
12 lines
220 B
Rust
//@ 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
|