diff options
author | Aleksey Kladov <[email protected]> | 2020-01-14 13:20:33 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-01-14 13:24:03 +0000 |
commit | 21c5fd8b1b8f9536449325738baea1e48efdefe0 (patch) | |
tree | 36fc95b08d825eb55f6621f9ff6bf86164dae157 /crates/ra_hir_ty/src/infer/expr.rs | |
parent | 7ec62ea5e686dcb6de5d3fcc413f32af9d1c9cb5 (diff) |
Push resolver further up
Diffstat (limited to 'crates/ra_hir_ty/src/infer/expr.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer/expr.rs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs index 3af05394c..d6a17e469 100644 --- a/crates/ra_hir_ty/src/infer/expr.rs +++ b/crates/ra_hir_ty/src/infer/expr.rs | |||
@@ -569,12 +569,19 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
569 | ) -> Ty { | 569 | ) -> Ty { |
570 | let receiver_ty = self.infer_expr(receiver, &Expectation::none()); | 570 | let receiver_ty = self.infer_expr(receiver, &Expectation::none()); |
571 | let canonicalized_receiver = self.canonicalizer().canonicalize_ty(receiver_ty.clone()); | 571 | let canonicalized_receiver = self.canonicalizer().canonicalize_ty(receiver_ty.clone()); |
572 | let resolved = method_resolution::lookup_method( | 572 | |
573 | &canonicalized_receiver.value, | 573 | let traits_in_scope = self.resolver.traits_in_scope(self.db); |
574 | self.db, | 574 | |
575 | method_name, | 575 | let resolved = self.resolver.krate().and_then(|krate| { |
576 | &self.resolver, | 576 | method_resolution::lookup_method( |
577 | ); | 577 | &canonicalized_receiver.value, |
578 | self.db, | ||
579 | self.trait_env.clone(), | ||
580 | krate, | ||
581 | &traits_in_scope, | ||
582 | method_name, | ||
583 | ) | ||
584 | }); | ||
578 | let (derefed_receiver_ty, method_ty, def_generics) = match resolved { | 585 | let (derefed_receiver_ty, method_ty, def_generics) = match resolved { |
579 | Some((ty, func)) => { | 586 | Some((ty, func)) => { |
580 | let ty = canonicalized_receiver.decanonicalize_ty(ty); | 587 | let ty = canonicalized_receiver.decanonicalize_ty(ty); |