aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ide/src/syntax_highlighting.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index 38546ead3..0a5f7a247 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -455,15 +455,10 @@ fn macro_call_range(macro_call: &ast::MacroCall) -> Option<TextRange> {
455} 455}
456 456
457fn is_possibly_unsafe(name_ref: &ast::NameRef) -> bool { 457fn is_possibly_unsafe(name_ref: &ast::NameRef) -> bool {
458 name_ref 458 match name_ref.syntax().parent() {
459 .syntax() 459 Some(parent) => matches!(parent.kind(), FIELD_EXPR | RECORD_PAT_FIELD),
460 .parent() 460 None => false,
461 .and_then(|parent| { 461 }
462 ast::FieldExpr::cast(parent.clone())
463 .map(|_| true)
464 .or_else(|| ast::RecordPatField::cast(parent).map(|_| true))
465 })
466 .unwrap_or(false)
467} 462}
468 463
469fn highlight_element( 464fn highlight_element(