about summary refs log tree commit diff
path: root/tests/ui/asm/non-const.rs
blob: dc9317b90b117fc30697ade4882d5eb345d2b698 (plain)
1
2
3
4
5
6
7
8
9
10
11
//@ 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 function