diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/fmt/ifmt-bad-arg.stderr | 98 |
1 files changed, 40 insertions, 58 deletions
diff --git a/src/test/ui/fmt/ifmt-bad-arg.stderr b/src/test/ui/fmt/ifmt-bad-arg.stderr index dbb4bc6d9..1b595a50e 100644 --- a/src/test/ui/fmt/ifmt-bad-arg.stderr +++ b/src/test/ui/fmt/ifmt-bad-arg.stderr @@ -5,10 +5,10 @@ LL | format!("{}"); | ^^ error: invalid reference to positional argument 1 (there is 1 argument) - --> $DIR/ifmt-bad-arg.rs:9:14 + --> $DIR/ifmt-bad-arg.rs:9:15 | LL | format!("{1}", 1); - | ^^^ + | ^ | = note: positional arguments are zero-based @@ -27,36 +27,32 @@ LL | format!("{} {}"); | ^^ ^^ error: invalid reference to positional argument 1 (there is 1 argument) - --> $DIR/ifmt-bad-arg.rs:16:18 + --> $DIR/ifmt-bad-arg.rs:16:19 | LL | format!("{0} {1}", 1); - | ^^^ + | ^ | = note: positional arguments are zero-based error: invalid reference to positional argument 2 (there are 2 arguments) - --> $DIR/ifmt-bad-arg.rs:19:22 + --> $DIR/ifmt-bad-arg.rs:19:23 | LL | format!("{0} {1} {2}", 1, 2); - | ^^^ + | ^ | = note: positional arguments are zero-based -error: invalid reference to positional argument 2 (there are 2 arguments) - --> $DIR/ifmt-bad-arg.rs:22:28 +error: 3 positional arguments in format string, but there are 2 arguments + --> $DIR/ifmt-bad-arg.rs:22:14 | LL | format!("{} {value} {} {}", 1, value=2); - | ^^ - | - = note: positional arguments are zero-based + | ^^ ^^ ^^ - - -error: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments) - --> $DIR/ifmt-bad-arg.rs:24:38 +error: 6 positional arguments in format string, but there are 3 arguments + --> $DIR/ifmt-bad-arg.rs:24:29 | LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2); - | ^^ ^^ ^^ - | - = note: positional arguments are zero-based + | ^^ ^^ ^^ ^^ ^^ ^^ - - - error: multiple unused formatting arguments --> $DIR/ifmt-bad-arg.rs:32:17 @@ -117,20 +113,20 @@ LL | format!("{} {}", 1, 2, foo=1, bar=2); | multiple missing formatting specifiers error: duplicate argument named `foo` - --> $DIR/ifmt-bad-arg.rs:40:33 + --> $DIR/ifmt-bad-arg.rs:40:29 | LL | format!("{foo}", foo=1, foo=2); - | - ^ duplicate argument - | | - | previously here + | --- ^^^ duplicate argument + | | + | previously here error: positional arguments cannot follow named arguments --> $DIR/ifmt-bad-arg.rs:41:35 | LL | format!("{foo} {} {}", foo=1, 2); - | - ^ positional arguments must be before named arguments - | | - | named argument + | ----- ^ positional arguments must be before named arguments + | | + | named argument error: named argument never used --> $DIR/ifmt-bad-arg.rs:45:51 @@ -191,33 +187,26 @@ error: 4 positional arguments in format string, but there are 3 arguments | LL | println!("{} {:.*} {}", 1, 3.2, 4); | ^^ ^^--^ ^^ - --- - - | | | - | | this parameter corresponds to the precision flag + | | | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected | = note: positional arguments are zero-based = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html -error: 4 positional arguments in format string, but there are 3 arguments - --> $DIR/ifmt-bad-arg.rs:81:15 +error: invalid reference to positional arguments 3 and 7 (there are 3 arguments) + --> $DIR/ifmt-bad-arg.rs:81:21 | LL | println!("{} {:07$.*} {}", 1, 3.2, 4); - | ^^ ^^^----^ ^^ - --- - - | | | | - | | | this parameter corresponds to the precision flag - | | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected - | this width flag expects an `usize` argument at position 7, but there are 3 arguments + | ^^ ^ | = note: positional arguments are zero-based = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html error: invalid reference to positional argument 7 (there are 3 arguments) - --> $DIR/ifmt-bad-arg.rs:84:18 + --> $DIR/ifmt-bad-arg.rs:84:21 | LL | println!("{} {:07$} {}", 1, 3.2, 4); - | ^^^--^ - | | - | this width flag expects an `usize` argument at position 7, but there are 3 arguments + | ^^ | = note: positional arguments are zero-based = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html @@ -240,24 +229,19 @@ LL | println!("{:foo}", 1); - `X`, which uses the `UpperHex` trait error: invalid reference to positional arguments 4, 5, 6 and 7 (there is 1 argument) - --> $DIR/ifmt-bad-arg.rs:87:15 + --> $DIR/ifmt-bad-arg.rs:87:16 | LL | println!("{5} {:4$} {6:7$}", 1); - | ^^^ ^^--^ ^^^--^ - | | | - | | this width flag expects an `usize` argument at position 7, but there is 1 argument - | this width flag expects an `usize` argument at position 4, but there is 1 argument + | ^ ^^ ^ ^^ | = note: positional arguments are zero-based = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html error: invalid reference to positional argument 0 (no arguments were given) - --> $DIR/ifmt-bad-arg.rs:90:15 + --> $DIR/ifmt-bad-arg.rs:90:20 | LL | println!("{foo:0$}"); - | ^^^^^--^ - | | - | this width flag expects an `usize` argument at position 0, but no arguments were given + | ^^ | = note: positional arguments are zero-based = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html @@ -273,13 +257,11 @@ LL | println!("{:.*}"); = note: positional arguments are zero-based = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html -error: 1 positional argument in format string, but no arguments were given - --> $DIR/ifmt-bad-arg.rs:97:15 +error: invalid reference to positional argument 0 (no arguments were given) + --> $DIR/ifmt-bad-arg.rs:97:16 | LL | println!("{:.0$}"); - | ^^---^ - | | - | this precision flag expects an `usize` argument at position 0, but no arguments were given + | ^^^^ | = note: positional arguments are zero-based = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html @@ -318,10 +300,10 @@ error[E0308]: mismatched types --> $DIR/ifmt-bad-arg.rs:78:32 | LL | println!("{} {:.*} {}", 1, 3.2, 4); - | ---------------------------^^^---- - | | | - | | expected `usize`, found floating-point number - | arguments to this function are incorrect + | ^^^ + | | + | expected `usize`, found floating-point number + | arguments to this function are incorrect | = note: expected reference `&usize` found reference `&{float}` @@ -336,10 +318,10 @@ error[E0308]: mismatched types --> $DIR/ifmt-bad-arg.rs:81:35 | LL | println!("{} {:07$.*} {}", 1, 3.2, 4); - | ------------------------------^^^---- - | | | - | | expected `usize`, found floating-point number - | arguments to this function are incorrect + | ^^^ + | | + | expected `usize`, found floating-point number + | arguments to this function are incorrect | = note: expected reference `&usize` found reference `&{float}` |