From 556c9cebdb91278702263df4ac8c99ec24ab331a Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 21 May 2021 17:41:20 +0200 Subject: Refactor expectation handling So as to not use `TyKind::Error` as "no expectation". --- crates/hir_ty/src/infer/coerce.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'crates/hir_ty/src/infer/coerce.rs') diff --git a/crates/hir_ty/src/infer/coerce.rs b/crates/hir_ty/src/infer/coerce.rs index 20c512517..03dd6ae76 100644 --- a/crates/hir_ty/src/infer/coerce.rs +++ b/crates/hir_ty/src/infer/coerce.rs @@ -21,10 +21,6 @@ impl<'a> InferenceContext<'a> { pub(super) fn coerce(&mut self, from_ty: &Ty, to_ty: &Ty) -> bool { let from_ty = self.resolve_ty_shallow(from_ty); let to_ty = self.resolve_ty_shallow(to_ty); - // TODO handle expectations properly - if to_ty.is_unknown() { - return true; - } match self.coerce_inner(from_ty, &to_ty) { Ok(result) => { self.table.register_infer_ok(result); -- cgit v1.2.3