Skip to content

Commit 9d1e8fe

Browse files
authored
Rollup merge of #81865 - bugadani:typeck2, r=jyn514
Clean up weird Option mapping
2 parents b376c50 + 37cbc08 commit 9d1e8fe

File tree

1 file changed

+3
-7
lines changed
  • compiler/rustc_typeck/src/check

1 file changed

+3
-7
lines changed

compiler/rustc_typeck/src/check/expr.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
285285
self.check_expr_eq_type(&e, ty);
286286
ty
287287
}
288-
ExprKind::If(ref cond, ref then_expr, ref opt_else_expr) => self.check_then_else(
289-
&cond,
290-
then_expr,
291-
opt_else_expr.as_ref().map(|e| &**e),
292-
expr.span,
293-
expected,
294-
),
288+
ExprKind::If(cond, then_expr, opt_else_expr) => {
289+
self.check_then_else(cond, then_expr, opt_else_expr, expr.span, expected)
290+
}
295291
ExprKind::DropTemps(ref e) => self.check_expr_with_expectation(e, expected),
296292
ExprKind::Array(ref args) => self.check_expr_array(args, expected, expr),
297293
ExprKind::ConstBlock(ref anon_const) => self.to_const(anon_const).ty,

0 commit comments

Comments
 (0)