blob: 87c2c4128aa5e00a383a47966cb862a6e9afbf38 [file]
//@ ignore-backends: gcc
// FIXME: linking on windows (specifically mingw) not yet supported, see tracking issue #125418
//@ ignore-windows
// Tests whether EIIs work on statics
#![feature(extern_item_impls)]
#[eii(hello)]
//~^ ERROR `#[eii]` cannot be used on mutable statics
static mut HELLO: u64;
#[hello]
//~^ ERROR mutability does not match with the definition of`#[hello]`
static HELLO_IMPL: u64 = 5;
// what you would write:
fn main() {
// directly
println!("{HELLO_IMPL}");
// through the alias
println!("{}", unsafe { HELLO });
}