From 788533d38091472ed05c8b55fd7a2002c49f4eb7 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 5 Apr 2021 21:14:49 +0200 Subject: Move ProjectionTy methods to extension trait --- crates/hir_ty/src/display.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (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 01c7ef91f..91d657ce2 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs @@ -22,7 +22,8 @@ use crate::{ lt_from_placeholder_idx, primitive, to_assoc_type_id, traits::chalk::from_chalk, utils::generics, AdtId, AliasEq, AliasTy, CallableDefId, CallableSig, DomainGoal, GenericArg, ImplTraitId, Interner, Lifetime, LifetimeData, LifetimeOutlives, Mutability, OpaqueTy, - ProjectionTy, QuantifiedWhereClause, Scalar, TraitRef, Ty, TyExt, TyKind, WhereClause, + ProjectionTy, ProjectionTyExt, QuantifiedWhereClause, Scalar, TraitRef, Ty, TyExt, TyKind, + WhereClause, }; pub struct HirFormatter<'a> { -- cgit v1.2.3 From b67148daea86d85d211c4243f22635d6ac7e1983 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 5 Apr 2021 21:56:40 +0200 Subject: Substitution::prefix -> subst_prefix I probably want to get rid of this function completely later. --- crates/hir_ty/src/display.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 91d657ce2..4ef8024d0 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs @@ -19,7 +19,7 @@ use hir_expand::name::Name; use crate::{ db::HirDatabase, from_assoc_type_id, from_foreign_def_id, from_placeholder_idx, - lt_from_placeholder_idx, primitive, to_assoc_type_id, traits::chalk::from_chalk, + lt_from_placeholder_idx, primitive, subst_prefix, to_assoc_type_id, traits::chalk::from_chalk, utils::generics, AdtId, AliasEq, AliasTy, CallableDefId, CallableSig, DomainGoal, GenericArg, ImplTraitId, Interner, Lifetime, LifetimeData, LifetimeOutlives, Mutability, OpaqueTy, ProjectionTy, ProjectionTyExt, QuantifiedWhereClause, Scalar, TraitRef, Ty, TyExt, TyKind, @@ -484,9 +484,11 @@ impl HirDisplay for Ty { default_from = i + 1; } (_, Some(default_parameter)) => { - let actual_default = default_parameter - .clone() - .substitute(&Interner, ¶meters.prefix(i)); + let actual_default = + default_parameter.clone().substitute( + &Interner, + &subst_prefix(parameters, i), + ); if parameter.assert_ty_ref(&Interner) != &actual_default { default_from = i + 1; -- cgit v1.2.3