From 3411fe3e84e641aad03abbc22eec33fdc29b15f8 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 14 Mar 2021 16:26:12 +0100 Subject: Rename some fields to their Chalk names --- crates/hir_ty/src/display.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/hir_ty/src/display.rs') diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs index e6473586b..21291ddda 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs @@ -245,19 +245,19 @@ impl HirDisplay for ProjectionTy { } let trait_ = f.db.trait_data(self.trait_(f.db)); - let first_parameter = self.parameters[0].into_displayable( + let first_parameter = self.substitution[0].into_displayable( f.db, f.max_size, f.omit_verbose_types, f.display_target, ); write!(f, "<{} as {}", first_parameter, trait_.name)?; - if self.parameters.len() > 1 { + if self.substitution.len() > 1 { write!(f, "<")?; - f.write_joined(&self.parameters[1..], ", ")?; + f.write_joined(&self.substitution[1..], ", ")?; write!(f, ">")?; } - write!(f, ">::{}", f.db.type_alias_data(from_assoc_type_id(self.associated_ty)).name)?; + write!(f, ">::{}", f.db.type_alias_data(from_assoc_type_id(self.associated_ty_id)).name)?; Ok(()) } } @@ -491,8 +491,8 @@ impl HirDisplay for Ty { } } else { let projection_ty = ProjectionTy { - associated_ty: to_assoc_type_id(type_alias), - parameters: parameters.clone(), + associated_ty_id: to_assoc_type_id(type_alias), + substitution: parameters.clone(), }; projection_ty.hir_fmt(f)?; @@ -709,7 +709,7 @@ fn write_bounds_like_dyn_trait( angle_open = true; } let type_alias = f.db.type_alias_data(from_assoc_type_id( - projection_pred.projection_ty.associated_ty, + projection_pred.projection_ty.associated_ty_id, )); write!(f, "{} = ", type_alias.name)?; projection_pred.ty.hir_fmt(f)?; @@ -782,7 +782,7 @@ impl HirDisplay for GenericPredicate { f, ">::{} = ", f.db.type_alias_data(from_assoc_type_id( - projection_pred.projection_ty.associated_ty + projection_pred.projection_ty.associated_ty_id )) .name, )?; -- cgit v1.2.3 From 195414783402d6973f4e673e84be9b7bc19cbfa6 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 14 Mar 2021 16:33:27 +0100 Subject: More renaming --- crates/hir_ty/src/display.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/display.rs') diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs index 21291ddda..378c951c5 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs @@ -319,7 +319,10 @@ impl HirDisplay for Ty { TyKind::Dyn(predicates) if predicates.len() > 1 => { Cow::Borrowed(predicates.as_ref()) } - &TyKind::Alias(AliasTy::Opaque(OpaqueTy { opaque_ty_id, ref parameters })) => { + &TyKind::Alias(AliasTy::Opaque(OpaqueTy { + opaque_ty_id, + substitution: ref parameters, + })) => { let impl_trait_id = f.db.lookup_intern_impl_trait_id(opaque_ty_id.into()); if let ImplTraitId::ReturnTypeImplTrait(func, idx) = impl_trait_id { datas = @@ -579,7 +582,7 @@ impl HirDisplay for Ty { let data = (*datas) .as_ref() .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone()); - let bounds = data.subst(&opaque_ty.parameters); + let bounds = data.subst(&opaque_ty.substitution); write_bounds_like_dyn_trait_with_prefix("impl", &bounds.value, f)?; } ImplTraitId::AsyncBlockTypeImplTrait(..) => { -- cgit v1.2.3