diff options
author | Florian Diebold <[email protected]> | 2021-04-05 18:15:13 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-04-05 18:21:03 +0100 |
commit | a316d583600e11ee1fcc8027a838efafe435f03c (patch) | |
tree | d4448b520724757956ba653e5c0a318b3abdb52c /crates/hir_ty/src/lower.rs | |
parent | fbab69cbffed37291b463c0e57fade49581e1de2 (diff) |
Rename shift_bound_vars{_out} to align with Chalk
Diffstat (limited to 'crates/hir_ty/src/lower.rs')
-rw-r--r-- | crates/hir_ty/src/lower.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index 66e72c814..48c26f471 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs | |||
@@ -483,7 +483,7 @@ impl<'a> TyLoweringContext<'a> { | |||
483 | }; | 483 | }; |
484 | // We need to shift in the bound vars, since | 484 | // We need to shift in the bound vars, since |
485 | // associated_type_shorthand_candidates does not do that | 485 | // associated_type_shorthand_candidates does not do that |
486 | let substs = substs.shift_bound_vars(self.in_binders); | 486 | let substs = substs.shifted_in_from(self.in_binders); |
487 | // FIXME handle type parameters on the segment | 487 | // FIXME handle type parameters on the segment |
488 | return Some( | 488 | return Some( |
489 | TyKind::Alias(AliasTy::Projection(ProjectionTy { | 489 | TyKind::Alias(AliasTy::Projection(ProjectionTy { |
@@ -831,20 +831,20 @@ pub fn associated_type_shorthand_candidates<R>( | |||
831 | }; | 831 | }; |
832 | 832 | ||
833 | match res { | 833 | match res { |
834 | // FIXME: how to correctly handle higher-ranked bounds here? | ||
835 | TypeNs::SelfType(impl_id) => search( | 834 | TypeNs::SelfType(impl_id) => search( |
836 | db.impl_trait(impl_id)? | 835 | // we're _in_ the impl -- the binders get added back later. Correct, |
837 | .into_value_and_skipped_binders() | 836 | // but it would be nice to make this more explicit |
838 | .0 | 837 | db.impl_trait(impl_id)?.into_value_and_skipped_binders().0, |
839 | .shift_bound_vars_out(DebruijnIndex::ONE), | ||
840 | ), | 838 | ), |
841 | TypeNs::GenericParam(param_id) => { | 839 | TypeNs::GenericParam(param_id) => { |
842 | let predicates = db.generic_predicates_for_param(param_id); | 840 | let predicates = db.generic_predicates_for_param(param_id); |
843 | let res = predicates.iter().find_map(|pred| match pred.skip_binders().skip_binders() { | 841 | let res = predicates.iter().find_map(|pred| match pred.skip_binders().skip_binders() { |
844 | // FIXME: how to correctly handle higher-ranked bounds here? | 842 | // FIXME: how to correctly handle higher-ranked bounds here? |
845 | WhereClause::Implemented(tr) => { | 843 | WhereClause::Implemented(tr) => search( |
846 | search(tr.clone().shift_bound_vars_out(DebruijnIndex::ONE)) | 844 | tr.clone() |
847 | } | 845 | .shifted_out_to(DebruijnIndex::ONE) |
846 | .expect("FIXME unexpected higher-ranked trait bound"), | ||
847 | ), | ||
848 | _ => None, | 848 | _ => None, |
849 | }); | 849 | }); |
850 | if let res @ Some(_) = res { | 850 | if let res @ Some(_) = res { |