aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/display.rs6
-rw-r--r--crates/hir/src/lib.rs2
2 files changed, 2 insertions, 6 deletions
diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs
index c96ebb50a..9f6d7be48 100644
--- a/crates/hir/src/display.rs
+++ b/crates/hir/src/display.rs
@@ -236,11 +236,7 @@ impl HirDisplay for TypeParam {
236 write!(f, "{}", self.name(f.db))?; 236 write!(f, "{}", self.name(f.db))?;
237 let bounds = f.db.generic_predicates_for_param(self.id); 237 let bounds = f.db.generic_predicates_for_param(self.id);
238 let substs = Substitution::type_params(f.db, self.id.parent); 238 let substs = Substitution::type_params(f.db, self.id.parent);
239 let predicates = bounds 239 let predicates = bounds.iter().cloned().map(|b| b.subst(&substs)).collect::<Vec<_>>();
240 .iter()
241 .cloned()
242 .map(|b| hir_ty::Binders::new(0, b.subst(&substs)))
243 .collect::<Vec<_>>();
244 if !(predicates.is_empty() || f.omit_verbose_types()) { 240 if !(predicates.is_empty() || f.omit_verbose_types()) {
245 write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?; 241 write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?;
246 } 242 }
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 1844942a6..a325b6691 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -1460,7 +1460,7 @@ impl TypeParam {
1460 pub fn trait_bounds(self, db: &dyn HirDatabase) -> Vec<Trait> { 1460 pub fn trait_bounds(self, db: &dyn HirDatabase) -> Vec<Trait> {
1461 db.generic_predicates_for_param(self.id) 1461 db.generic_predicates_for_param(self.id)
1462 .into_iter() 1462 .into_iter()
1463 .filter_map(|pred| match &pred.value { 1463 .filter_map(|pred| match &pred.skip_binders().skip_binders() {
1464 hir_ty::WhereClause::Implemented(trait_ref) => { 1464 hir_ty::WhereClause::Implemented(trait_ref) => {
1465 Some(Trait::from(trait_ref.hir_trait_id())) 1465 Some(Trait::from(trait_ref.hir_trait_id()))
1466 } 1466 }