mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Ty -> Type
This commit is contained in:
parent
12bf008ab1
commit
ccd5268374
1 changed files with 7 additions and 2 deletions
|
@ -990,10 +990,15 @@ impl TypeParam {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn default(self, db: &dyn HirDatabase) -> Option<Ty> {
|
pub fn default(self, db: &dyn HirDatabase) -> Option<Type> {
|
||||||
let params = db.generic_defaults(self.id.parent);
|
let params = db.generic_defaults(self.id.parent);
|
||||||
let local_idx = hir_ty::param_idx(db, self.id)?;
|
let local_idx = hir_ty::param_idx(db, self.id)?;
|
||||||
params.get(local_idx).map(|d| d.clone())
|
let resolver = self.id.parent.resolver(db.upcast());
|
||||||
|
let environment = TraitEnvironment::lower(db, &resolver);
|
||||||
|
params.get(local_idx).cloned().map(|ty| Type {
|
||||||
|
krate: self.id.parent.module(db.upcast()).krate,
|
||||||
|
ty: InEnvironment { value: ty, environment },
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue