From e1c18f4d9de902ad615035bfed4e173d72f7ff09 Mon Sep 17 00:00:00 2001 From: francorbacho Date: Wed, 4 Oct 2023 17:38:46 +0200 Subject: [PATCH] Document report_redundant_format_arguments() --- compiler/rustc_builtin_macros/src/format.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_builtin_macros/src/format.rs b/compiler/rustc_builtin_macros/src/format.rs index 8cdab65b6b32..2d91de105cda 100644 --- a/compiler/rustc_builtin_macros/src/format.rs +++ b/compiler/rustc_builtin_macros/src/format.rs @@ -708,6 +708,8 @@ fn report_missing_placeholders( diag.emit(); } +/// This function detects and reports unused format!() arguments that are +/// redundant due to implicit captures (e.g. `format!("{x}", x)`). fn report_redundant_format_arguments( ecx: &mut ExtCtxt<'_>, fmt_span: Span,