mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
22 lines
398 B
Rust
22 lines
398 B
Rust
//@ needs-asm-support
|
|
//@ ignore-nvptx64
|
|
//@ ignore-spirv
|
|
|
|
#![feature(const_refs_to_static)]
|
|
|
|
use std::arch::{asm, global_asm};
|
|
use std::ptr::addr_of;
|
|
|
|
static FOO: u8 = 42;
|
|
|
|
global_asm!("{}", const addr_of!(FOO));
|
|
//~^ ERROR invalid type for `const` operand
|
|
|
|
#[no_mangle]
|
|
fn inline() {
|
|
unsafe { asm!("{}", const addr_of!(FOO)) };
|
|
//~^ ERROR invalid type for `const` operand
|
|
}
|
|
|
|
fn main() {}
|