Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/symbols.rs')
-rw-r--r--crates/hir/src/symbols.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/hir/src/symbols.rs b/crates/hir/src/symbols.rs
index e1101dd823..28ac5940e6 100644
--- a/crates/hir/src/symbols.rs
+++ b/crates/hir/src/symbols.rs
@@ -262,9 +262,7 @@ impl<'a> SymbolCollector<'a> {
DefWithBodyId::FunctionId(id) => Some(self.db.function_data(id).name.to_smol_str()),
DefWithBodyId::StaticId(id) => Some(self.db.static_data(id).name.to_smol_str()),
DefWithBodyId::ConstId(id) => Some(self.db.const_data(id).name.as_ref()?.to_smol_str()),
- DefWithBodyId::VariantId(id) => {
- Some(self.db.enum_data(id.parent).variants[id.local_id].name.to_smol_str())
- }
+ DefWithBodyId::VariantId(id) => Some(self.db.enum_variant_data(id).name.to_smol_str()),
DefWithBodyId::InTypeConstId(_) => Some("in type const".into()),
}
}