aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-10-09 01:57:35 +0100
committerJonas Schievink <[email protected]>2020-10-09 01:57:35 +0100
commit468b80485644bf1b15dee97d15029378f0f6d199 (patch)
tree4d9f2e64cc20459dc3bc71088332880baab81a29 /crates/hir
parent636b413e142e2b831ded74642c8193a0dc39b4a7 (diff)
Fix source_to_def for named enum variant fields
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/semantics/source_to_def.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir/src/semantics/source_to_def.rs b/crates/hir/src/semantics/source_to_def.rs
index 5918b9541..66fc11611 100644
--- a/crates/hir/src/semantics/source_to_def.rs
+++ b/crates/hir/src/semantics/source_to_def.rs
@@ -189,6 +189,10 @@ impl SourceToDefCtx<'_, '_> {
189 let def = self.type_alias_to_def(container.with_value(it))?; 189 let def = self.type_alias_to_def(container.with_value(it))?;
190 def.into() 190 def.into()
191 }, 191 },
192 ast::Variant(it) => {
193 let def = self.enum_variant_to_def(container.with_value(it))?;
194 VariantId::from(def).into()
195 },
192 _ => continue, 196 _ => continue,
193 } 197 }
194 }; 198 };