Skip to content

Commit 6cc9895

Browse files
committed
Fix lowering captured format args more than once.
1 parent d57fa21 commit 6cc9895

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

compiler/rustc_ast_lowering/src/format.rs

-2
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,6 @@ fn expand_format_args<'hir>(
522522
// Don't care about non-arguments.
523523
.filter(|(&(arg, _), _)| arg != usize::MAX)
524524
.enumerate()
525-
// Don't care about captured arguments, as their expression has no side effects.
526-
.filter(|(_, (&(arg, _), _))| !arguments[arg].kind.is_captured())
527525
// Check that the argument indexes are used one by one in order.
528526
.all(|(i, (&(arg, _), _))| i == arg)
529527
// And check that none except possibly the first argument have a yield point.

0 commit comments

Comments
 (0)