Skip to content

Commit

Permalink
Rollup merge of #81865 - bugadani:typeck2, r=jyn514
Browse files Browse the repository at this point in the history
Clean up weird Option mapping
  • Loading branch information
m-ou-se authored Feb 8, 2021
2 parents b376c50 + 37cbc08 commit 9d1e8fe
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions compiler/rustc_typeck/src/check/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
self.check_expr_eq_type(&e, ty);
ty
}
ExprKind::If(ref cond, ref then_expr, ref opt_else_expr) => self.check_then_else(
&cond,
then_expr,
opt_else_expr.as_ref().map(|e| &**e),
expr.span,
expected,
),
ExprKind::If(cond, then_expr, opt_else_expr) => {
self.check_then_else(cond, then_expr, opt_else_expr, expr.span, expected)
}
ExprKind::DropTemps(ref e) => self.check_expr_with_expectation(e, expected),
ExprKind::Array(ref args) => self.check_expr_array(args, expected, expr),
ExprKind::ConstBlock(ref anon_const) => self.to_const(anon_const).ty,
Expand Down

0 comments on commit 9d1e8fe

Please sign in to comment.