aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/infer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/infer.rs')
-rw-r--r--crates/ra_hir/src/ty/infer.rs9
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;
24use hir_def::{ 24use 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};
29use hir_expand::{diagnostics::DiagnosticSink, name}; 29use hir_expand::{diagnostics::DiagnosticSink, name};
30use ra_arena::map::ArenaMap; 30use ra_arena::map::ArenaMap;
@@ -65,7 +65,7 @@ mod coerce;
65/// The entry point of type inference. 65/// The entry point of type inference.
66pub fn infer_query(db: &impl HirDatabase, def: DefWithBody) -> Arc<InferenceResult> { 66pub 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)) => {