From 6be528da0de45606498a9755ad2c54f3bc41dc6c Mon Sep 17 00:00:00 2001 From: Paul Daniel Faria Date: Thu, 6 Aug 2020 19:58:37 -0400 Subject: Add test for accessing static mut --- crates/ra_ide/src/syntax_highlighting/tests.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/ra_ide/src/syntax_highlighting') diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs index 2deee404c..b9b358022 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ra_ide/src/syntax_highlighting/tests.rs @@ -281,6 +281,12 @@ impl HasUnsafeFn { unsafe fn unsafe_method(&self) {} } +struct TypeForStaticMut { + a: u8 +} + +static mut global_mut: TypeForStaticMut = TypeForStaticMut { a: 0 }; + fn main() { let x = &5 as *const usize; unsafe { @@ -288,6 +294,7 @@ fn main() { HasUnsafeFn.unsafe_method(); let y = *(x); let z = -x; + let a = global_mut.a; } } "# -- cgit v1.2.3