mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Complete assoc. items on type parameters
This commit is contained in:
parent
4ff3573e18
commit
8c2670026a
5 changed files with 408 additions and 69 deletions
|
@ -953,6 +953,16 @@ impl TypeParam {
|
|||
pub fn module(self, db: &dyn HirDatabase) -> Module {
|
||||
self.id.parent.module(db.upcast()).into()
|
||||
}
|
||||
|
||||
pub fn ty(self, db: &dyn HirDatabase) -> Type {
|
||||
let resolver = self.id.parent.resolver(db.upcast());
|
||||
let environment = TraitEnvironment::lower(db, &resolver);
|
||||
let ty = Ty::Placeholder(self.id);
|
||||
Type {
|
||||
krate: self.id.parent.module(db.upcast()).krate,
|
||||
ty: InEnvironment { value: ty, environment },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: rename from `ImplDef` to `Impl`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue