]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/check/coercion.rs
re-base and use `OutlivesEnvironment::with_bounds`
[rust.git] / compiler / rustc_typeck / src / check / coercion.rs
index da575cb1367b8ea23c164ec96f629275e09db5e9..def592c46c2e514a4614813094b79fe193deaf3c 100644 (file)
@@ -1488,14 +1488,14 @@ pub(crate) fn coerce_inner<'a>(
                     // `break`, we want to call the `()` "expected"
                     // since it is implied by the syntax.
                     // (Note: not all force-units work this way.)"
-                    (expression_ty, self.final_ty.unwrap_or(self.expected_ty))
+                    (expression_ty, self.merged_ty())
                 } else {
                     // Otherwise, the "expected" type for error
                     // reporting is the current unification type,
                     // which is basically the LUB of the expressions
                     // we've seen so far (combined with the expected
                     // type)
-                    (self.final_ty.unwrap_or(self.expected_ty), expression_ty)
+                    (self.merged_ty(), expression_ty)
                 };
                 let (expected, found) = fcx.resolve_vars_if_possible((expected, found));