diff options
author | Aleksey Kladov <[email protected]> | 2019-11-21 12:24:51 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-21 12:24:51 +0000 |
commit | 00684d708b64fe81a0264795f27594d450a8d08d (patch) | |
tree | 031d8f3859fd7d38279c96be34afb09c85e2f74d /crates/ra_hir/src/ty/infer.rs | |
parent | eb53aa37a336b6c9369ea931812f6c491e8f4a71 (diff) |
Decouple
Diffstat (limited to 'crates/ra_hir/src/ty/infer.rs')
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 684d66946..c3d65afa6 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -24,7 +24,7 @@ use rustc_hash::FxHashMap; | |||
24 | use hir_def::{ | 24 | use hir_def::{ |
25 | path::known, | 25 | path::known, |
26 | type_ref::{Mutability, TypeRef}, | 26 | type_ref::{Mutability, TypeRef}, |
27 | AdtId, | 27 | AdtId, DefWithBodyId, |
28 | }; | 28 | }; |
29 | use hir_expand::{diagnostics::DiagnosticSink, name}; | 29 | use hir_expand::{diagnostics::DiagnosticSink, name}; |
30 | use ra_arena::map::ArenaMap; | 30 | use ra_arena::map::ArenaMap; |
@@ -65,7 +65,7 @@ mod coerce; | |||
65 | /// The entry point of type inference. | 65 | /// The entry point of type inference. |
66 | pub fn infer_query(db: &impl HirDatabase, def: DefWithBody) -> Arc<InferenceResult> { | 66 | pub fn infer_query(db: &impl HirDatabase, def: DefWithBody) -> Arc<InferenceResult> { |
67 | let _p = profile("infer_query"); | 67 | let _p = profile("infer_query"); |
68 | let resolver = def.resolver(db); | 68 | let resolver = DefWithBodyId::from(def).resolver(db); |
69 | let mut ctx = InferenceContext::new(db, def, resolver); | 69 | let mut ctx = InferenceContext::new(db, def, resolver); |
70 | 70 | ||
71 | match def { | 71 | match def { |
@@ -378,8 +378,9 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
378 | for obligation in obligations { | 378 | for obligation in obligations { |
379 | let in_env = InEnvironment::new(self.trait_env.clone(), obligation.clone()); | 379 | let in_env = InEnvironment::new(self.trait_env.clone(), obligation.clone()); |
380 | let canonicalized = self.canonicalizer().canonicalize_obligation(in_env); | 380 | let canonicalized = self.canonicalizer().canonicalize_obligation(in_env); |
381 | let solution = | 381 | let solution = self |
382 | self.db.trait_solve(self.resolver.krate().unwrap(), canonicalized.value.clone()); | 382 | .db |
383 | .trait_solve(self.resolver.krate().unwrap().into(), canonicalized.value.clone()); | ||
383 | 384 | ||
384 | match solution { | 385 | match solution { |
385 | Some(Solution::Unique(substs)) => { | 386 | Some(Solution::Unique(substs)) => { |