Add LifetimeParam resolving to Semantics

This commit is contained in:
Lukas Wirth 2020-12-13 22:13:16 +01:00
parent dbd0cfba53
commit c6172f3f6d
8 changed files with 131 additions and 39 deletions

View file

@ -1250,6 +1250,14 @@ impl LifetimeParam {
let params = db.generic_params(self.id.parent);
params.lifetimes[self.id.local_id].name.clone()
}
pub fn module(self, db: &dyn HirDatabase) -> Module {
self.id.parent.module(db.upcast()).into()
}
pub fn parent(self, _db: &dyn HirDatabase) -> GenericDef {
self.id.parent.into()
}
}
// FIXME: rename from `ImplDef` to `Impl`