about summary refs log tree commit diff
diff options
context:
space:
mode:
authorfrancorbacho <francorbacho@proton.me>2023-10-05 14:32:56 +0200
committerfrancorbacho <francorbacho@proton.me>2023-10-05 16:11:31 +0200
commitfcdd5c0b2d754c513241d62c5692be2197458b08 (patch)
tree7d5045d64643a2d934757e2d47dff916c1faa033
parent4a7a98cf3058f68f94c3cac1e6dfaa2f3282680c (diff)
downloadrust-fcdd5c0b2d754c513241d62c5692be2197458b08.tar.gz
rust-fcdd5c0b2d754c513241d62c5692be2197458b08.zip
Plurals in format redundant arguments suggestion
-rw-r--r--compiler/rustc_builtin_macros/messages.ftl5
-rw-r--r--tests/ui/did_you_mean/issue-105225.stderr4
2 files changed, 6 insertions, 3 deletions
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);