We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d9a588 commit c1c6e3aCopy full SHA for c1c6e3a
compiler/rustc_builtin_macros/src/format.rs
@@ -308,12 +308,15 @@ pub fn make_format_args(
308
.iter()
309
.position(|arg| arg.1.ident().is_some_and(|id| id.name == name))
310
{
311
+ // Name found in `args`, so we resolve it to its index in that Vec.
312
let index = start_of_named_args + i;
313
if !matches!(args[index].1, FormatArgKind::Captured(_)) {
314
+ // Mark it as used, if it was an explicit argument.
315
used[index] = true;
316
}
317
Ok(index)
318
} else {
319
+ // Name not found in `args`, so we add it as an implicitly captured argument.
320
let span = span.unwrap_or(fmt_span);
321
let ident = Ident::new(name, span);
322
let arg = if is_literal {
0 commit comments