From 05eba0db3dd76f016aabdd49af6211e70a1812ed Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 5 Apr 2021 18:39:53 +0200 Subject: Binders::subst -> substitute --- crates/hir/src/display.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/hir/src/display.rs') diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs index 993772aac..d4e477a85 100644 --- a/crates/hir/src/display.rs +++ b/crates/hir/src/display.rs @@ -235,7 +235,7 @@ impl HirDisplay for TypeParam { write!(f, "{}", self.name(f.db))?; let bounds = f.db.generic_predicates_for_param(self.id); let substs = TyBuilder::type_params_subst(f.db, self.id.parent); - let predicates = bounds.iter().cloned().map(|b| b.subst(&substs)).collect::>(); + let predicates = bounds.iter().cloned().map(|b| b.substitute(&substs)).collect::>(); if !(predicates.is_empty() || f.omit_verbose_types()) { write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?; } -- cgit v1.2.3 From 30a339e038bfd94d8c91f79287be9b7db4f0cb4e Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 5 Apr 2021 18:49:26 +0200 Subject: Add Interner parameter to Binders::substitute --- crates/hir/src/display.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/hir/src/display.rs') diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs index d4e477a85..01a4d205f 100644 --- a/crates/hir/src/display.rs +++ b/crates/hir/src/display.rs @@ -9,6 +9,7 @@ use hir_ty::display::{ write_bounds_like_dyn_trait_with_prefix, write_visibility, HirDisplay, HirDisplayError, HirFormatter, }; +use hir_ty::Interner; use syntax::ast::{self, NameOwner}; use crate::{ @@ -235,7 +236,8 @@ impl HirDisplay for TypeParam { write!(f, "{}", self.name(f.db))?; let bounds = f.db.generic_predicates_for_param(self.id); let substs = TyBuilder::type_params_subst(f.db, self.id.parent); - let predicates = bounds.iter().cloned().map(|b| b.substitute(&substs)).collect::>(); + let predicates = + bounds.iter().cloned().map(|b| b.substitute(&Interner, &substs)).collect::>(); if !(predicates.is_empty() || f.omit_verbose_types()) { write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?; } -- cgit v1.2.3