rust/tests/ui/consts/static_mut_containing_mut_ref2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
339 B
Rust
Raw Normal View History

2019-11-28 10:57:34 -06:00
// revisions: stock mut_refs
#![cfg_attr(mut_refs, feature(const_mut_refs))]
2018-12-17 07:20:42 -06:00
static mut STDERR_BUFFER_SPACE: u8 = 0;
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
2018-12-17 07:20:42 -06:00
fn main() {}