aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/infer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/infer.rs')
-rw-r--r--crates/ra_hir_ty/src/infer.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs
index a9d958c8b..76069eb9c 100644
--- a/crates/ra_hir_ty/src/infer.rs
+++ b/crates/ra_hir_ty/src/infer.rs
@@ -225,14 +225,14 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
225 coerce_unsized_map: Self::init_coerce_unsized_map(db, &resolver), 225 coerce_unsized_map: Self::init_coerce_unsized_map(db, &resolver),
226 db, 226 db,
227 owner, 227 owner,
228 body: db.body(owner.into()), 228 body: db.body(owner),
229 resolver, 229 resolver,
230 } 230 }
231 } 231 }
232 232
233 fn resolve_all(mut self) -> InferenceResult { 233 fn resolve_all(mut self) -> InferenceResult {
234 // FIXME resolve obligations as well (use Guidance if necessary) 234 // FIXME resolve obligations as well (use Guidance if necessary)
235 let mut result = mem::replace(&mut self.result, InferenceResult::default()); 235 let mut result = std::mem::take(&mut self.result);
236 for ty in result.type_of_expr.values_mut() { 236 for ty in result.type_of_expr.values_mut() {
237 let resolved = self.table.resolve_ty_completely(mem::replace(ty, Ty::Unknown)); 237 let resolved = self.table.resolve_ty_completely(mem::replace(ty, Ty::Unknown));
238 *ty = resolved; 238 *ty = resolved;
@@ -261,7 +261,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
261 } 261 }
262 262
263 fn write_assoc_resolution(&mut self, id: ExprOrPatId, item: AssocItemId) { 263 fn write_assoc_resolution(&mut self, id: ExprOrPatId, item: AssocItemId) {
264 self.result.assoc_resolutions.insert(id, item.into()); 264 self.result.assoc_resolutions.insert(id, item);
265 } 265 }
266 266
267 fn write_pat_ty(&mut self, pat: PatId, ty: Ty) { 267 fn write_pat_ty(&mut self, pat: PatId, ty: Ty) {
@@ -312,9 +312,8 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
312 for obligation in obligations { 312 for obligation in obligations {
313 let in_env = InEnvironment::new(self.trait_env.clone(), obligation.clone()); 313 let in_env = InEnvironment::new(self.trait_env.clone(), obligation.clone());
314 let canonicalized = self.canonicalizer().canonicalize_obligation(in_env); 314 let canonicalized = self.canonicalizer().canonicalize_obligation(in_env);
315 let solution = self 315 let solution =
316 .db 316 self.db.trait_solve(self.resolver.krate().unwrap(), canonicalized.value.clone());
317 .trait_solve(self.resolver.krate().unwrap().into(), canonicalized.value.clone());
318 317
319 match solution { 318 match solution {
320 Some(Solution::Unique(substs)) => { 319 Some(Solution::Unique(substs)) => {