diff options
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 10 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/infer/unify.rs | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index cb28fc6bc..ebaff998e 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -414,7 +414,9 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
414 | // recursive type | 414 | // recursive type |
415 | return tv.fallback_value(); | 415 | return tv.fallback_value(); |
416 | } | 416 | } |
417 | if let Some(known_ty) = self.var_unification_table.probe_value(inner).known() { | 417 | if let Some(known_ty) = |
418 | self.var_unification_table.inlined_probe_value(inner).known() | ||
419 | { | ||
418 | // known_ty may contain other variables that are known by now | 420 | // known_ty may contain other variables that are known by now |
419 | tv_stack.push(inner); | 421 | tv_stack.push(inner); |
420 | let result = self.resolve_ty_as_possible(tv_stack, known_ty.clone()); | 422 | let result = self.resolve_ty_as_possible(tv_stack, known_ty.clone()); |
@@ -442,7 +444,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
442 | match &*ty { | 444 | match &*ty { |
443 | Ty::Infer(tv) => { | 445 | Ty::Infer(tv) => { |
444 | let inner = tv.to_inner(); | 446 | let inner = tv.to_inner(); |
445 | match self.var_unification_table.probe_value(inner).known() { | 447 | match self.var_unification_table.inlined_probe_value(inner).known() { |
446 | Some(known_ty) => { | 448 | Some(known_ty) => { |
447 | // The known_ty can't be a type var itself | 449 | // The known_ty can't be a type var itself |
448 | ty = Cow::Owned(known_ty.clone()); | 450 | ty = Cow::Owned(known_ty.clone()); |
@@ -490,7 +492,9 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
490 | // recursive type | 492 | // recursive type |
491 | return tv.fallback_value(); | 493 | return tv.fallback_value(); |
492 | } | 494 | } |
493 | if let Some(known_ty) = self.var_unification_table.probe_value(inner).known() { | 495 | if let Some(known_ty) = |
496 | self.var_unification_table.inlined_probe_value(inner).known() | ||
497 | { | ||
494 | // known_ty may contain other variables that are known by now | 498 | // known_ty may contain other variables that are known by now |
495 | tv_stack.push(inner); | 499 | tv_stack.push(inner); |
496 | let result = self.resolve_ty_completely(tv_stack, known_ty.clone()); | 500 | let result = self.resolve_ty_completely(tv_stack, known_ty.clone()); |
diff --git a/crates/ra_hir/src/ty/infer/unify.rs b/crates/ra_hir/src/ty/infer/unify.rs index 014c7981f..ca33cc7f8 100644 --- a/crates/ra_hir/src/ty/infer/unify.rs +++ b/crates/ra_hir/src/ty/infer/unify.rs | |||
@@ -54,7 +54,9 @@ where | |||
54 | // recursive type | 54 | // recursive type |
55 | return tv.fallback_value(); | 55 | return tv.fallback_value(); |
56 | } | 56 | } |
57 | if let Some(known_ty) = self.ctx.var_unification_table.probe_value(inner).known() { | 57 | if let Some(known_ty) = |
58 | self.ctx.var_unification_table.inlined_probe_value(inner).known() | ||
59 | { | ||
58 | self.var_stack.push(inner); | 60 | self.var_stack.push(inner); |
59 | let result = self.do_canonicalize_ty(known_ty.clone()); | 61 | let result = self.do_canonicalize_ty(known_ty.clone()); |
60 | self.var_stack.pop(); | 62 | self.var_stack.pop(); |