aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/infer/coerce.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-12-08 10:23:05 +0000
committerFlorian Diebold <[email protected]>2019-12-08 12:06:59 +0000
commitd0c9bb0abf764a3143fc0d13297d73184bc10397 (patch)
tree34e392bae6422cec8d8ef8ab975fbb48db4b808d /crates/ra_hir_ty/src/infer/coerce.rs
parent596e6db46c9c79b2b2be20a4b5461dca35d44b0f (diff)
Fix coercion from &Foo to an inference variable in a reference
We didn't try to unify within the reference, but we should.
Diffstat (limited to 'crates/ra_hir_ty/src/infer/coerce.rs')
-rw-r--r--crates/ra_hir_ty/src/infer/coerce.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_hir_ty/src/infer/coerce.rs b/crates/ra_hir_ty/src/infer/coerce.rs
index 9daa77cfa..0f4dac45e 100644
--- a/crates/ra_hir_ty/src/infer/coerce.rs
+++ b/crates/ra_hir_ty/src/infer/coerce.rs
@@ -332,7 +332,11 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
332 // It will not recurse to `coerce`. 332 // It will not recurse to `coerce`.
333 return self.table.unify_substs(st1, st2, 0); 333 return self.table.unify_substs(st1, st2, 0);
334 } 334 }
335 _ => {} 335 _ => {
336 if self.table.unify_inner_trivial(&derefed_ty, &to_ty) {
337 return true;
338 }
339 }
336 } 340 }
337 } 341 }
338 342