diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-05 18:25:19 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-05 18:25:19 +0100 |
commit | c91b5376835ab54cd4bca02953625ef1f1fabeba (patch) | |
tree | 390be0ec3c0a57db5188b06c86f0a7df0242b01c /crates/hir/src/display.rs | |
parent | 467a5c6cd13af6ccb76e9ebdb35f96fc10fb438f (diff) | |
parent | a316d583600e11ee1fcc8027a838efafe435f03c (diff) |
Merge #8348
8348: Make `Binders` more like Chalk r=flodiebold a=flodiebold
Working towards #8313.
- hide `value`
- use `VariableKinds`
- adjust `subst` to be like Chalk's `substitute`
- also clean up some other `TypeWalk` stuff to prepare for it being replaced by Chalk's `Fold`
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir/src/display.rs')
-rw-r--r-- | crates/hir/src/display.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs index 993772aac..01a4d205f 100644 --- a/crates/hir/src/display.rs +++ b/crates/hir/src/display.rs | |||
@@ -9,6 +9,7 @@ use hir_ty::display::{ | |||
9 | write_bounds_like_dyn_trait_with_prefix, write_visibility, HirDisplay, HirDisplayError, | 9 | write_bounds_like_dyn_trait_with_prefix, write_visibility, HirDisplay, HirDisplayError, |
10 | HirFormatter, | 10 | HirFormatter, |
11 | }; | 11 | }; |
12 | use hir_ty::Interner; | ||
12 | use syntax::ast::{self, NameOwner}; | 13 | use syntax::ast::{self, NameOwner}; |
13 | 14 | ||
14 | use crate::{ | 15 | use crate::{ |
@@ -235,7 +236,8 @@ impl HirDisplay for TypeParam { | |||
235 | write!(f, "{}", self.name(f.db))?; | 236 | write!(f, "{}", self.name(f.db))?; |
236 | let bounds = f.db.generic_predicates_for_param(self.id); | 237 | let bounds = f.db.generic_predicates_for_param(self.id); |
237 | let substs = TyBuilder::type_params_subst(f.db, self.id.parent); | 238 | let substs = TyBuilder::type_params_subst(f.db, self.id.parent); |
238 | let predicates = bounds.iter().cloned().map(|b| b.subst(&substs)).collect::<Vec<_>>(); | 239 | let predicates = |
240 | bounds.iter().cloned().map(|b| b.substitute(&Interner, &substs)).collect::<Vec<_>>(); | ||
239 | if !(predicates.is_empty() || f.omit_verbose_types()) { | 241 | if !(predicates.is_empty() || f.omit_verbose_types()) { |
240 | write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?; | 242 | write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?; |
241 | } | 243 | } |