mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
11 lines
251 B
Rust
11 lines
251 B
Rust
#![allow(static_mut_ref)]
|
|
|
|
const C1: &'static mut [usize] = &mut [];
|
|
//~^ ERROR: mutable references are not allowed
|
|
|
|
static mut S: usize = 3;
|
|
const C2: &'static mut usize = unsafe { &mut S };
|
|
//~^ ERROR: referencing statics in constants
|
|
|
|
fn main() {}
|