Skip to content

Commit e221aaf

Browse files
authored
Rollup merge of #100307 - nnethercote:fix-96847, r=cjgillot
Fix #96847 r? `@petrochenkov`
2 parents bd64d67 + ce78042 commit e221aaf

23 files changed

+17
-5
lines changed

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,15 +1536,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
15361536
hir::MatchSource::ForLoopDesugar,
15371537
));
15381538

1539-
let attrs: Vec<_> = e.attrs.iter().map(|a| self.lower_attr(a)).collect();
1540-
15411539
// This is effectively `{ let _result = ...; _result }`.
15421540
// The construct was introduced in #21984 and is necessary to make sure that
15431541
// temporaries in the `head` expression are dropped and do not leak to the
15441542
// surrounding scope of the `match` since the `match` is not a terminating scope.
15451543
//
15461544
// Also, add the attributes to the outer returned expr node.
1547-
self.expr_drop_temps_mut(for_span, match_expr, attrs.into())
1545+
self.expr_drop_temps_mut(for_span, match_expr, e.attrs.clone())
15481546
}
15491547

15501548
/// Desugar `ExprKind::Try` from: `<expr>?` into:

src/test/ui/json-multiple.stderr

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/test/ui/json-options.stderr

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)