mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
12 lines
304 B
Rust
12 lines
304 B
Rust
static S: i32 = 0;
|
|
static mut S_MUT: i32 = 0;
|
|
|
|
const C1: &i32 = &S; //~ERROR: referencing statics in constants is unstable
|
|
const C1_READ: () = {
|
|
assert!(*C1 == 0);
|
|
};
|
|
const C2: *const i32 = unsafe { std::ptr::addr_of!(S_MUT) }; //~ERROR: referencing statics in constants is unstable
|
|
|
|
fn main() {
|
|
}
|