2024-02-17 19:01:56 +00:00
|
|
|
#![allow(static_mut_refs)]
|
2024-02-12 14:14:58 +00:00
|
|
|
|
2015-01-08 11:02:42 +00:00
|
|
|
const C1: &'static mut [usize] = &mut [];
|
2021-01-03 18:46:20 +00:00
|
|
|
//~^ ERROR: mutable references are not allowed
|
2014-10-07 04:16:35 +00:00
|
|
|
|
2015-01-08 11:02:42 +00:00
|
|
|
static mut S: usize = 3;
|
2016-05-02 22:57:35 +00:00
|
|
|
const C2: &'static mut usize = unsafe { &mut S };
|
2024-01-05 11:18:11 +00:00
|
|
|
//~^ ERROR: referencing statics in constants
|
2024-02-11 13:27:08 +00:00
|
|
|
//~| ERROR: mutable references are not allowed
|
2014-10-07 04:16:35 +00:00
|
|
|
|
|
|
|
fn main() {}
|