Skip to content

Commit f53c217

Browse files
committed
review comments
1 parent aae2b24 commit f53c217

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/librustc_typeck/check/_match.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
117117
&arms[0].body,
118118
&mut coercion,
119119
) {
120-
tcx.types.err
120+
tcx.types.err
121121
} else {
122122
// Only call this if this is not an `if` expr with an expected type and no `else`
123123
// clause to avoid duplicated type errors. (#60254)
124-
let arm_ty = self.check_expr_with_expectation(&arm.body, expected);
125-
all_arms_diverge &= self.diverges.get();
126-
arm_ty
124+
self.check_expr_with_expectation(&arm.body, expected)
127125
};
126+
all_arms_diverge &= self.diverges.get();
128127
if source_if {
129128
let then_expr = &arms[0].body;
130129
match (i, if_no_else) {
@@ -188,6 +187,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
188187
}
189188

190189
/// Handle the fallback arm of a desugared if(-let) like a missing else.
190+
///
191+
/// Returns `true` if there was an error forcing the coercion to the `()` type.
191192
fn if_fallback_coercion(
192193
&self,
193194
span: Span,

0 commit comments

Comments
 (0)