aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r--crates/ra_ide/src/syntax_highlighting.rs1
-rw-r--r--crates/ra_ide/src/syntax_highlighting/tests.rs7
2 files changed, 8 insertions, 0 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs
index bfe6143ca..f71b804fe 100644
--- a/crates/ra_ide/src/syntax_highlighting.rs
+++ b/crates/ra_ide/src/syntax_highlighting.rs
@@ -710,6 +710,7 @@ fn highlight_name(db: &RootDatabase, def: Definition, possibly_unsafe: bool) ->
710 let mut h = Highlight::new(HighlightTag::Static); 710 let mut h = Highlight::new(HighlightTag::Static);
711 if s.is_mut(db) { 711 if s.is_mut(db) {
712 h |= HighlightModifier::Mutable; 712 h |= HighlightModifier::Mutable;
713 h |= HighlightModifier::Unsafe;
713 } 714 }
714 return h; 715 return h;
715 } 716 }
diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs
index a09422da3..730efff0d 100644
--- a/crates/ra_ide/src/syntax_highlighting/tests.rs
+++ b/crates/ra_ide/src/syntax_highlighting/tests.rs
@@ -286,6 +286,12 @@ impl HasUnsafeFn {
286 unsafe fn unsafe_method(&self) {} 286 unsafe fn unsafe_method(&self) {}
287} 287}
288 288
289struct TypeForStaticMut {
290 a: u8
291}
292
293static mut global_mut: TypeForStaticMut = TypeForStaticMut { a: 0 };
294
289fn main() { 295fn main() {
290 let x = &5 as *const usize; 296 let x = &5 as *const usize;
291 let u = Union { b: 0 }; 297 let u = Union { b: 0 };
@@ -299,6 +305,7 @@ fn main() {
299 HasUnsafeFn.unsafe_method(); 305 HasUnsafeFn.unsafe_method();
300 let y = *(x); 306 let y = *(x);
301 let z = -x; 307 let z = -x;
308 let a = global_mut.a;
302 } 309 }
303} 310}
304"# 311"#