mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Highlight mutable statics as mutable
This commit is contained in:
parent
4578154b60
commit
11c0a5bb60
7 changed files with 56 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue