diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-05 20:59:25 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-05 20:59:25 +0100 |
commit | f25c1e7c6a119a1035ba226f0735a0d6667a5db8 (patch) | |
tree | 0f666c5b917de8a0f2ebf5fba185500d153036f3 /crates/hir_ty/src/display.rs | |
parent | 8c96a7d81e29061537d78b5670a3474cb136422d (diff) | |
parent | b67148daea86d85d211c4243f22635d6ac7e1983 (diff) |
Merge #8356
8356: Align more methods to Chalk r=flodiebold a=flodiebold
Related to #8313.
Move some inherent methods that don't exist in Chalk to an extension trait, remove some others.
Co-authored-by: Florian Diebold <[email protected]>
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; |