Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/syntax_highlighting/highlight.rs')
| -rw-r--r-- | crates/ide/src/syntax_highlighting/highlight.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index f82566d978..dba0636930 100644 --- a/crates/ide/src/syntax_highlighting/highlight.rs +++ b/crates/ide/src/syntax_highlighting/highlight.rs @@ -286,7 +286,9 @@ fn highlight_name_ref( Definition::ModuleDef(hir::ModuleDef::Trait(trait_)) if trait_.is_unsafe(db) => { - if ast::Impl::for_trait_name_ref(&name_ref).is_some() { + if ast::Impl::for_trait_name_ref(&name_ref) + .map_or(false, |impl_| impl_.unsafe_token().is_some()) + { h |= HlMod::Unsafe; } } |