path::GenericArgs,
path::Path,
type_ref::{Mutability, TypeRef},
- ContainerId, DefWithBodyId, EnumLoc, FunctionLoc, Intern, ModuleDefId, StructLoc, UnionLoc,
+ ConstLoc, ContainerId, DefWithBodyId, EnumLoc, FunctionLoc, Intern, ModuleDefId, StaticLoc,
+ StructLoc, TypeAliasLoc, UnionLoc,
};
pub(super) fn lower(
let ast_id = self.expander.ast_id(&def);
FunctionLoc { container: container.into(), ast_id }.intern(self.db).into()
}
+ ast::ModuleItem::TypeAliasDef(def) => {
+ let ast_id = self.expander.ast_id(&def);
+ TypeAliasLoc { container: container.into(), ast_id }.intern(self.db).into()
+ }
+ ast::ModuleItem::ConstDef(def) => {
+ let ast_id = self.expander.ast_id(&def);
+ ConstLoc { container: container.into(), ast_id }.intern(self.db).into()
+ }
+ ast::ModuleItem::StaticDef(def) => {
+ let ast_id = self.expander.ast_id(&def);
+ StaticLoc { container, ast_id }.intern(self.db).into()
+ }
ast::ModuleItem::StructDef(def) => {
let ast_id = self.expander.ast_id(&def);
StructLoc { container, ast_id }.intern(self.db).into()
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct StaticLoc {
- pub container: ModuleId,
+ pub container: ContainerId,
pub ast_id: AstId<ast::StaticDef>,
}
}
impl HasModule for StaticLoc {
- fn module(&self, _db: &impl db::DefDatabase) -> ModuleId {
- self.container
+ fn module(&self, db: &impl db::DefDatabase) -> ModuleId {
+ self.container.module(db)
}
}
PerNs::values(def.into())
}
raw::DefKind::Static(ast_id) => {
- let def = StaticLoc { container: module, ast_id: AstId::new(self.file_id, ast_id) }
+ let def = StaticLoc { container, ast_id: AstId::new(self.file_id, ast_id) }
.intern(self.def_collector.db);
PerNs::values(def.into())