mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Explicitly check for reference locals or fields in Name classification
This commit is contained in:
parent
87621de2b9
commit
c65bb7f8b9
11 changed files with 67 additions and 50 deletions
|
@ -58,10 +58,8 @@ pub(super) fn element(
|
|||
Some(NameClass::ConstReference(def)) => highlight_def(db, krate, def),
|
||||
Some(NameClass::PatFieldShorthand { field_ref, .. }) => {
|
||||
let mut h = HlTag::Symbol(SymbolKind::Field).into();
|
||||
if let Definition::Field(field) = field_ref {
|
||||
if let hir::VariantDef::Union(_) = field.parent_def(db) {
|
||||
h |= HlMod::Unsafe;
|
||||
}
|
||||
if let hir::VariantDef::Union(_) = field_ref.parent_def(db) {
|
||||
h |= HlMod::Unsafe;
|
||||
}
|
||||
h
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue