diff options
Diffstat (limited to 'crates/hir_ty/src/method_resolution.rs')
-rw-r--r-- | crates/hir_ty/src/method_resolution.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs index 0abe8f0a3..8e986ddde 100644 --- a/crates/hir_ty/src/method_resolution.rs +++ b/crates/hir_ty/src/method_resolution.rs | |||
@@ -376,7 +376,7 @@ fn iterate_method_candidates_impl( | |||
376 | // Also note that when we've got a receiver like &S, even if the method we | 376 | // Also note that when we've got a receiver like &S, even if the method we |
377 | // find in the end takes &self, we still do the autoderef step (just as | 377 | // find in the end takes &self, we still do the autoderef step (just as |
378 | // rustc does an autoderef and then autoref again). | 378 | // rustc does an autoderef and then autoref again). |
379 | let ty = InEnvironment { value: ty.clone(), environment: env.clone() }; | 379 | let ty = InEnvironment { goal: ty.clone(), environment: env.env.clone() }; |
380 | 380 | ||
381 | // We have to be careful about the order we're looking at candidates | 381 | // We have to be careful about the order we're looking at candidates |
382 | // in here. Consider the case where we're resolving `x.clone()` | 382 | // in here. Consider the case where we're resolving `x.clone()` |
@@ -622,7 +622,7 @@ pub fn resolve_indexing_op( | |||
622 | krate: CrateId, | 622 | krate: CrateId, |
623 | index_trait: TraitId, | 623 | index_trait: TraitId, |
624 | ) -> Option<Canonical<Ty>> { | 624 | ) -> Option<Canonical<Ty>> { |
625 | let ty = InEnvironment { value: ty.clone(), environment: env.clone() }; | 625 | let ty = InEnvironment { goal: ty.clone(), environment: env.env.clone() }; |
626 | let deref_chain = autoderef_method_receiver(db, krate, ty); | 626 | let deref_chain = autoderef_method_receiver(db, krate, ty); |
627 | for ty in deref_chain { | 627 | for ty in deref_chain { |
628 | let goal = generic_implements_goal(db, env.clone(), index_trait, ty.clone()); | 628 | let goal = generic_implements_goal(db, env.clone(), index_trait, ty.clone()); |
@@ -794,7 +794,7 @@ fn generic_implements_goal( | |||
794 | let obligation = trait_ref.cast(&Interner); | 794 | let obligation = trait_ref.cast(&Interner); |
795 | Canonical { | 795 | Canonical { |
796 | binders: CanonicalVarKinds::from_iter(&Interner, kinds), | 796 | binders: CanonicalVarKinds::from_iter(&Interner, kinds), |
797 | value: InEnvironment::new(env, obligation), | 797 | value: InEnvironment::new(env.env.clone(), obligation), |
798 | } | 798 | } |
799 | } | 799 | } |
800 | 800 | ||