2019-11-28 11:57:34 -05:00
|
|
|
// revisions: stock mut_refs
|
|
|
|
|
|
|
|
#![cfg_attr(mut_refs, feature(const_mut_refs))]
|
|
|
|
|
2018-12-17 14:20:42 +01:00
|
|
|
static mut STDERR_BUFFER_SPACE: u8 = 0;
|
|
|
|
|
2023-12-22 15:12:01 +03:00
|
|
|
pub static mut STDERR_BUFFER: () = unsafe {
|
|
|
|
*(&mut STDERR_BUFFER_SPACE) = 42;
|
|
|
|
//[mut_refs]~^ ERROR could not evaluate static initializer
|
|
|
|
//[stock]~^^ ERROR mutable references are not allowed in statics
|
|
|
|
//[mut_refs]~^^^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
|
|
|
|
//[stock]~^^^^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
|
|
|
|
};
|
2018-12-17 14:20:42 +01:00
|
|
|
|
|
|
|
fn main() {}
|