Skip to content

Commit ccd5268

Browse files
committed
Ty -> Type
1 parent 12bf008 commit ccd5268

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crates/ra_hir/src/code_model.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,10 +990,15 @@ impl TypeParam {
990990
}
991991
}
992992

993-
pub fn default(self, db: &dyn HirDatabase) -> Option<Ty> {
993+
pub fn default(self, db: &dyn HirDatabase) -> Option<Type> {
994994
let params = db.generic_defaults(self.id.parent);
995995
let local_idx = hir_ty::param_idx(db, self.id)?;
996-
params.get(local_idx).map(|d| d.clone())
996+
let resolver = self.id.parent.resolver(db.upcast());
997+
let environment = TraitEnvironment::lower(db, &resolver);
998+
params.get(local_idx).cloned().map(|ty| Type {
999+
krate: self.id.parent.module(db.upcast()).krate,
1000+
ty: InEnvironment { value: ty, environment },
1001+
})
9971002
}
9981003
}
9991004

0 commit comments

Comments
 (0)