diff --git a/compiler/rustc_builtin_macros/messages.ftl b/compiler/rustc_builtin_macros/messages.ftl index ce3d07c59de..8f158fb17da 100644 --- a/compiler/rustc_builtin_macros/messages.ftl +++ b/compiler/rustc_builtin_macros/messages.ftl @@ -139,7 +139,10 @@ builtin_macros_format_positional_after_named = positional arguments cannot follo builtin_macros_format_remove_raw_ident = remove the `r#` -builtin_macros_format_redundant_args = redundant argument +builtin_macros_format_redundant_args = redundant {$n -> + [one] argument + *[more] arguments + } .help = {$n -> [one] the formatting string already captures the binding directly, it doesn't need to be included in the argument list *[more] the formatting strings already captures the bindings directly, they don't need to be included in the argument list diff --git a/tests/ui/did_you_mean/issue-105225.stderr b/tests/ui/did_you_mean/issue-105225.stderr index 8c366f31311..dc18e7268b4 100644 --- a/tests/ui/did_you_mean/issue-105225.stderr +++ b/tests/ui/did_you_mean/issue-105225.stderr @@ -34,7 +34,7 @@ note: the formatting specifier is referencing the binding already LL | println!("{} {x}", x, x); | ^ -error: redundant argument +error: redundant arguments --> $DIR/issue-105225.rs:13:14 | LL | println!("{x} {y}", x, y); @@ -51,7 +51,7 @@ LL - println!("{x} {y}", x, y); LL + println!("{x} {y}", ); | -error: redundant argument +error: redundant arguments --> $DIR/issue-105225.rs:17:14 | LL | println!("{} {} {x} {y} {}", x, x, x, y, y);