From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/fmt/ifmt-bad-arg.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/test/ui/fmt/ifmt-bad-arg.rs') diff --git a/src/test/ui/fmt/ifmt-bad-arg.rs b/src/test/ui/fmt/ifmt-bad-arg.rs index f00cb05c9..68861d7bf 100644 --- a/src/test/ui/fmt/ifmt-bad-arg.rs +++ b/src/test/ui/fmt/ifmt-bad-arg.rs @@ -20,9 +20,9 @@ fn main() { //~^ ERROR: invalid reference to positional argument 2 (there are 2 arguments) format!("{} {value} {} {}", 1, value=2); - //~^ ERROR: invalid reference to positional argument 2 (there are 2 arguments) + //~^ ERROR: 3 positional arguments in format string, but there are 2 arguments format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2); - //~^ ERROR: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments) + //~^ ERROR: 6 positional arguments in format string, but there are 3 arguments format!("{} {foo} {} {bar} {}", 1, 2, 3); //~^ ERROR: cannot find value `foo` in this scope @@ -79,7 +79,7 @@ tenth number: {}", //~^ ERROR 4 positional arguments in format string, but there are 3 arguments //~| ERROR mismatched types println!("{} {:07$.*} {}", 1, 3.2, 4); - //~^ ERROR 4 positional arguments in format string, but there are 3 arguments + //~^ ERROR invalid reference to positional arguments 3 and 7 (there are 3 arguments) //~| ERROR mismatched types println!("{} {:07$} {}", 1, 3.2, 4); //~^ ERROR invalid reference to positional argument 7 (there are 3 arguments) @@ -95,5 +95,5 @@ tenth number: {}", println!("{:.*}"); //~^ ERROR 2 positional arguments in format string, but no arguments were given println!("{:.0$}"); - //~^ ERROR 1 positional argument in format string, but no arguments were given + //~^ ERROR invalid reference to positional argument 0 (no arguments were given) } -- cgit v1.2.3