mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Don't highlight unsafe traits as unsafe in safe impls
This commit is contained in:
parent
64fb7be247
commit
33cdc21832
12 changed files with 44 additions and 56 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue