mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-27 06:14:55 +00:00
Ty -> Type
This commit is contained in:
parent
12bf008ab1
commit
ccd5268374
@ -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 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…
Reference in New Issue
Block a user