Skip to content

Commit c413bb4

Browse files
committed
Auto merge of #28973 - nrc:match-source, r=Manishearth
r? @Manishearth
2 parents 8fbb35b + 254a10b commit c413bb4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/librustc_front/lowering.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,11 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
14221422
vec![head])
14231423
};
14241424

1425-
let match_expr = expr_match(lctx, e.span, into_iter_expr, vec![iter_arm]);
1425+
let match_expr = expr_match(lctx,
1426+
e.span,
1427+
into_iter_expr,
1428+
vec![iter_arm],
1429+
hir::MatchSource::ForLoopDesugar);
14261430

14271431
// `{ let result = ...; result }`
14281432
let result_ident = lctx.str_to_ident("result");
@@ -1574,11 +1578,12 @@ fn expr_path(lctx: &LoweringContext, path: hir::Path) -> P<hir::Expr> {
15741578
fn expr_match(lctx: &LoweringContext,
15751579
span: Span,
15761580
arg: P<hir::Expr>,
1577-
arms: Vec<hir::Arm>)
1581+
arms: Vec<hir::Arm>,
1582+
source: hir::MatchSource)
15781583
-> P<hir::Expr> {
15791584
expr(lctx,
15801585
span,
1581-
hir::ExprMatch(arg, arms, hir::MatchSource::Normal))
1586+
hir::ExprMatch(arg, arms, source))
15821587
}
15831588

15841589
fn expr_block(lctx: &LoweringContext, b: P<hir::Block>) -> P<hir::Expr> {

0 commit comments

Comments
 (0)