mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
408eeae59d
Rename `static_mut_ref` lint to `static_mut_refs`.
11 lines
299 B
Rust
11 lines
299 B
Rust
#![allow(static_mut_refs)]
|
|
|
|
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
|
|
//~| ERROR: mutable references are not allowed
|
|
|
|
fn main() {}
|