diff options
Diffstat (limited to 'crates/hir_ty/src/display.rs')
-rw-r--r-- | crates/hir_ty/src/display.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs index 01c7ef91f..4ef8024d0 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs | |||
@@ -19,10 +19,11 @@ use hir_expand::name::Name; | |||
19 | 19 | ||
20 | use crate::{ | 20 | use crate::{ |
21 | db::HirDatabase, from_assoc_type_id, from_foreign_def_id, from_placeholder_idx, | 21 | db::HirDatabase, from_assoc_type_id, from_foreign_def_id, from_placeholder_idx, |
22 | lt_from_placeholder_idx, primitive, to_assoc_type_id, traits::chalk::from_chalk, | 22 | lt_from_placeholder_idx, primitive, subst_prefix, to_assoc_type_id, traits::chalk::from_chalk, |
23 | utils::generics, AdtId, AliasEq, AliasTy, CallableDefId, CallableSig, DomainGoal, GenericArg, | 23 | utils::generics, AdtId, AliasEq, AliasTy, CallableDefId, CallableSig, DomainGoal, GenericArg, |
24 | ImplTraitId, Interner, Lifetime, LifetimeData, LifetimeOutlives, Mutability, OpaqueTy, | 24 | ImplTraitId, Interner, Lifetime, LifetimeData, LifetimeOutlives, Mutability, OpaqueTy, |
25 | ProjectionTy, QuantifiedWhereClause, Scalar, TraitRef, Ty, TyExt, TyKind, WhereClause, | 25 | ProjectionTy, ProjectionTyExt, QuantifiedWhereClause, Scalar, TraitRef, Ty, TyExt, TyKind, |
26 | WhereClause, | ||
26 | }; | 27 | }; |
27 | 28 | ||
28 | pub struct HirFormatter<'a> { | 29 | pub struct HirFormatter<'a> { |
@@ -483,9 +484,11 @@ impl HirDisplay for Ty { | |||
483 | default_from = i + 1; | 484 | default_from = i + 1; |
484 | } | 485 | } |
485 | (_, Some(default_parameter)) => { | 486 | (_, Some(default_parameter)) => { |
486 | let actual_default = default_parameter | 487 | let actual_default = |
487 | .clone() | 488 | default_parameter.clone().substitute( |
488 | .substitute(&Interner, ¶meters.prefix(i)); | 489 | &Interner, |
490 | &subst_prefix(parameters, i), | ||
491 | ); | ||
489 | if parameter.assert_ty_ref(&Interner) != &actual_default | 492 | if parameter.assert_ty_ref(&Interner) != &actual_default |
490 | { | 493 | { |
491 | default_from = i + 1; | 494 | default_from = i + 1; |