Closed
Description
MIR borrowck errors out on assignments to mutable statics, which should be allowed (in unsafe code) e.g.
static mut Y: u32 = 0;
unsafe fn should_ok() {
Y = 1;
}
fn main() {}
which causes:
$ rustc x.rs -Z borrowck-mir
error: cannot assign to immutable static item Y (Mir)
--> x.rs:5:5
|
5 | Y = 1;
| ^^^^^
error: aborting due to previous error