Highlight mutable statics as mutable

This commit is contained in:
Matthew Jasper 2020-05-10 16:08:28 +01:00
parent 4578154b60
commit 11c0a5bb60
7 changed files with 56 additions and 13 deletions

View file

@ -17,6 +17,8 @@ struct Foo {
pub y: i32,
}
static mut STATIC_MUT: i32 = 0;
fn foo<'a, T>() -> T {
foo::<'a, i32>()
}
@ -40,7 +42,10 @@ fn main() {
let x = 92;
vec.push(Foo { x, y: 1 });
}
unsafe { vec.set_len(0); }
unsafe {
vec.set_len(0);
STATIC_MUT = 1;
}
let mut x = 42;
let y = &mut x;