Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Sep 1, 2019
1 parent aae2b24 commit f53c217
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/librustc_typeck/check/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
&arms[0].body,
&mut coercion,
) {
tcx.types.err
tcx.types.err
} else {
// Only call this if this is not an `if` expr with an expected type and no `else`
// clause to avoid duplicated type errors. (#60254)
let arm_ty = self.check_expr_with_expectation(&arm.body, expected);
all_arms_diverge &= self.diverges.get();
arm_ty
self.check_expr_with_expectation(&arm.body, expected)
};
all_arms_diverge &= self.diverges.get();
if source_if {
let then_expr = &arms[0].body;
match (i, if_no_else) {
Expand Down Expand Up @@ -188,6 +187,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}

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

0 comments on commit f53c217

Please sign in to comment.