aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorFedor Sakharov <[email protected]>2020-05-14 11:53:45 +0100
committerFedor Sakharov <[email protected]>2020-05-14 11:53:45 +0100
commitccd526837459724211c8281926aa86522b2506d5 (patch)
tree60c3623eaf5a9414a3dd043e67a0c39b98ef592c /crates/ra_hir
parent12bf008ab12f87b2e6d4805681f5a389d9e2f425 (diff)
Ty -> Type
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index cdbf475b3..840cfdfc8 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -990,10 +990,15 @@ impl TypeParam {
990 } 990 }
991 } 991 }
992 992
993 pub fn default(self, db: &dyn HirDatabase) -> Option<Ty> { 993 pub fn default(self, db: &dyn HirDatabase) -> Option<Type> {
994 let params = db.generic_defaults(self.id.parent); 994 let params = db.generic_defaults(self.id.parent);
995 let local_idx = hir_ty::param_idx(db, self.id)?; 995 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 })
997 } 1002 }
998} 1003}
999 1004