Skip to content

Commit c1c6e3a

Browse files
committed
Add clarifying comments.
1 parent 8d9a588 commit c1c6e3a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: compiler/rustc_builtin_macros/src/format.rs

+3
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,15 @@ pub fn make_format_args(
308308
.iter()
309309
.position(|arg| arg.1.ident().is_some_and(|id| id.name == name))
310310
{
311+
// Name found in `args`, so we resolve it to its index in that Vec.
311312
let index = start_of_named_args + i;
312313
if !matches!(args[index].1, FormatArgKind::Captured(_)) {
314+
// Mark it as used, if it was an explicit argument.
313315
used[index] = true;
314316
}
315317
Ok(index)
316318
} else {
319+
// Name not found in `args`, so we add it as an implicitly captured argument.
317320
let span = span.unwrap_or(fmt_span);
318321
let ident = Ident::new(name, span);
319322
let arg = if is_literal {

0 commit comments

Comments
 (0)