Skip to content

Commit fcdd5c0

Browse files
committed
Plurals in format redundant arguments suggestion
1 parent 4a7a98c commit fcdd5c0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

compiler/rustc_builtin_macros/messages.ftl

+4-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ builtin_macros_format_positional_after_named = positional arguments cannot follo
139139
140140
builtin_macros_format_remove_raw_ident = remove the `r#`
141141
142-
builtin_macros_format_redundant_args = redundant argument
142+
builtin_macros_format_redundant_args = redundant {$n ->
143+
[one] argument
144+
*[more] arguments
145+
}
143146
.help = {$n ->
144147
[one] the formatting string already captures the binding directly, it doesn't need to be included in the argument list
145148
*[more] the formatting strings already captures the bindings directly, they don't need to be included in the argument list

tests/ui/did_you_mean/issue-105225.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ note: the formatting specifier is referencing the binding already
3434
LL | println!("{} {x}", x, x);
3535
| ^
3636

37-
error: redundant argument
37+
error: redundant arguments
3838
--> $DIR/issue-105225.rs:13:14
3939
|
4040
LL | println!("{x} {y}", x, y);
@@ -51,7 +51,7 @@ LL - println!("{x} {y}", x, y);
5151
LL + println!("{x} {y}", );
5252
|
5353

54-
error: redundant argument
54+
error: redundant arguments
5555
--> $DIR/issue-105225.rs:17:14
5656
|
5757
LL | println!("{} {} {x} {y} {}", x, x, x, y, y);

0 commit comments

Comments
 (0)