Eagerly lower enum variants in CrateDefMap construction

This commit is contained in:
Lukas Wirth 2024-01-15 10:24:14 +01:00
parent 9d8889cdfc
commit d80d2fcae0
49 changed files with 553 additions and 593 deletions

View file

@ -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()),
}
}