Skip to content

Commit 033387a

Browse files
authored
Rollup merge of rust-lang#100629 - GuillaumeGomez:merged-ty, r=compiler-errors
Use `merged_ty` method instead of rewriting it every time `merged_ty` [source code](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_typeck/check/coercion.rs.html#1331-1333) is quite literally the same, so instead of rewriting it, makes more sense to use the method instead. r? `@compiler-errors`
2 parents b7b4f79 + 1f7d1ea commit 033387a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_typeck/src/check/coercion.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1488,14 +1488,14 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
14881488
// `break`, we want to call the `()` "expected"
14891489
// since it is implied by the syntax.
14901490
// (Note: not all force-units work this way.)"
1491-
(expression_ty, self.final_ty.unwrap_or(self.expected_ty))
1491+
(expression_ty, self.merged_ty())
14921492
} else {
14931493
// Otherwise, the "expected" type for error
14941494
// reporting is the current unification type,
14951495
// which is basically the LUB of the expressions
14961496
// we've seen so far (combined with the expected
14971497
// type)
1498-
(self.final_ty.unwrap_or(self.expected_ty), expression_ty)
1498+
(self.merged_ty(), expression_ty)
14991499
};
15001500
let (expected, found) = fcx.resolve_vars_if_possible((expected, found));
15011501

0 commit comments

Comments
 (0)