aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits/chalk/mapping.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-05 16:47:09 +0100
committerGitHub <[email protected]>2021-04-05 16:47:09 +0100
commit013cc7dd8b4b4cc9f7dca706917b15a34e85ccba (patch)
tree511c31f0b647044294eba7c4394ee3e4ba7b13b6 /crates/hir_ty/src/traits/chalk/mapping.rs
parentfab1c066464022613729a6d714dc83b7d698ece5 (diff)
parentd7546d8c2323adff53c8170c528e82a8131681c5 (diff)
Merge #8344
8344: Pass interner to `ProjectionTy::self_type_parameter` and `TraitRef::self_type_parameter` r=flodiebold a=lnicola CC #8313 changelog skip Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/traits/chalk/mapping.rs')
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index 59aaa5560..67e88ebf4 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -539,7 +539,7 @@ pub(super) fn generic_predicate_to_inline_bound(
539 let self_ty_shifted_in = self_ty.clone().shift_bound_vars(DebruijnIndex::ONE); 539 let self_ty_shifted_in = self_ty.clone().shift_bound_vars(DebruijnIndex::ONE);
540 match &pred.value { 540 match &pred.value {
541 WhereClause::Implemented(trait_ref) => { 541 WhereClause::Implemented(trait_ref) => {
542 if trait_ref.self_type_parameter() != &self_ty_shifted_in { 542 if trait_ref.self_type_parameter(&Interner) != &self_ty_shifted_in {
543 // we can only convert predicates back to type bounds if they 543 // we can only convert predicates back to type bounds if they
544 // have the expected self type 544 // have the expected self type
545 return None; 545 return None;
@@ -552,7 +552,7 @@ pub(super) fn generic_predicate_to_inline_bound(
552 Some(make_binders(rust_ir::InlineBound::TraitBound(trait_bound), pred.num_binders)) 552 Some(make_binders(rust_ir::InlineBound::TraitBound(trait_bound), pred.num_binders))
553 } 553 }
554 WhereClause::AliasEq(AliasEq { alias: AliasTy::Projection(projection_ty), ty }) => { 554 WhereClause::AliasEq(AliasEq { alias: AliasTy::Projection(projection_ty), ty }) => {
555 if projection_ty.self_type_parameter() != &self_ty_shifted_in { 555 if projection_ty.self_type_parameter(&Interner) != &self_ty_shifted_in {
556 return None; 556 return None;
557 } 557 }
558 let trait_ = projection_ty.trait_(db); 558 let trait_ = projection_ty.trait_(db);