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