aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/method_resolution.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/method_resolution.rs')
-rw-r--r--crates/hir_ty/src/method_resolution.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs
index bf7d5eded..054896475 100644
--- a/crates/hir_ty/src/method_resolution.rs
+++ b/crates/hir_ty/src/method_resolution.rs
@@ -720,7 +720,7 @@ pub(crate) fn inherent_impl_substs(
720 chalk_ir::VariableKind::Ty(chalk_ir::TyVariableKind::General), 720 chalk_ir::VariableKind::Ty(chalk_ir::TyVariableKind::General),
721 UniverseIndex::ROOT, 721 UniverseIndex::ROOT,
722 )) 722 ))
723 .take(vars.len()), 723 .take(vars.len(&Interner)),
724 ); 724 );
725 let tys = Canonical { 725 let tys = Canonical {
726 binders: CanonicalVarKinds::from_iter(&Interner, kinds), 726 binders: CanonicalVarKinds::from_iter(&Interner, kinds),
@@ -732,7 +732,8 @@ pub(crate) fn inherent_impl_substs(
732 // Unknown. I think this can only really happen if self_ty contained 732 // Unknown. I think this can only really happen if self_ty contained
733 // Unknown, and in that case we want the result to contain Unknown in those 733 // Unknown, and in that case we want the result to contain Unknown in those
734 // places again. 734 // places again.
735 substs.map(|s| fallback_bound_vars(s.suffix(vars.len()), self_ty.binders.len(&Interner))) 735 substs
736 .map(|s| fallback_bound_vars(s.suffix(vars.len(&Interner)), self_ty.binders.len(&Interner)))
736} 737}
737 738
738/// This replaces any 'free' Bound vars in `s` (i.e. those with indices past 739/// This replaces any 'free' Bound vars in `s` (i.e. those with indices past
@@ -821,7 +822,7 @@ fn generic_implements_goal(
821 chalk_ir::VariableKind::Ty(chalk_ir::TyVariableKind::General), 822 chalk_ir::VariableKind::Ty(chalk_ir::TyVariableKind::General),
822 UniverseIndex::ROOT, 823 UniverseIndex::ROOT,
823 )) 824 ))
824 .take(substs.len() - 1), 825 .take(substs.len(&Interner) - 1),
825 ); 826 );
826 let trait_ref = TraitRef { trait_id: to_chalk_trait_id(trait_), substitution: substs }; 827 let trait_ref = TraitRef { trait_id: to_chalk_trait_id(trait_), substitution: substs };
827 let obligation = trait_ref.cast(&Interner); 828 let obligation = trait_ref.cast(&Interner);