diff options
author | Florian Diebold <[email protected]> | 2021-05-16 16:56:38 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-05-21 16:49:07 +0100 |
commit | 4bd446f5b3f8035d5db1fde1c6c50073e3f4fb2b (patch) | |
tree | fee7c98d53e93b9a1d743450d290fa1cb2ae0df4 /crates/hir_ty/src/infer/coerce.rs | |
parent | a78f0076abbbf61f7b68ce5c323639037c8a72de (diff) |
Get rid of resolve_ty_as_possible
Instead use shallow resolving where necessary.
Diffstat (limited to 'crates/hir_ty/src/infer/coerce.rs')
-rw-r--r-- | crates/hir_ty/src/infer/coerce.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_ty/src/infer/coerce.rs b/crates/hir_ty/src/infer/coerce.rs index c85c088f7..00b2b585f 100644 --- a/crates/hir_ty/src/infer/coerce.rs +++ b/crates/hir_ty/src/infer/coerce.rs | |||
@@ -19,12 +19,12 @@ impl<'a> InferenceContext<'a> { | |||
19 | /// Unify two types, but may coerce the first one to the second one | 19 | /// Unify two types, but may coerce the first one to the second one |
20 | /// using "implicit coercion rules" if needed. | 20 | /// using "implicit coercion rules" if needed. |
21 | pub(super) fn coerce(&mut self, from_ty: &Ty, to_ty: &Ty) -> bool { | 21 | pub(super) fn coerce(&mut self, from_ty: &Ty, to_ty: &Ty) -> bool { |
22 | let from_ty = self.resolve_ty_shallow(from_ty); | ||
23 | let to_ty = self.resolve_ty_shallow(to_ty); | ||
22 | // TODO handle expectations properly | 24 | // TODO handle expectations properly |
23 | if to_ty.is_unknown() { | 25 | if to_ty.is_unknown() { |
24 | return true; | 26 | return true; |
25 | } | 27 | } |
26 | let from_ty = self.resolve_ty_shallow(from_ty); | ||
27 | let to_ty = self.resolve_ty_shallow(to_ty); | ||
28 | match self.coerce_inner(from_ty, &to_ty) { | 28 | match self.coerce_inner(from_ty, &to_ty) { |
29 | Ok(_result) => { | 29 | Ok(_result) => { |
30 | // TODO deal with goals | 30 | // TODO deal with goals |