From afa719e2eed83d7a7820e3a26194a26d55029536 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Mon, 1 Nov 2021 17:51:54 +0100 Subject: [PATCH] Update test output --- .../format-args-capture-macro-hygiene.stderr | 4 +- ...rmat-args-capture-missing-variables.stderr | 14 ++-- src/test/ui/fmt/ifmt-bad-arg.rs | 10 +-- src/test/ui/fmt/ifmt-bad-arg.stderr | 68 +++++++++---------- 4 files changed, 46 insertions(+), 50 deletions(-) diff --git a/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr b/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr index 33cd89ad5a7..9423e8c819d 100644 --- a/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr +++ b/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr @@ -1,5 +1,5 @@ error: there is no argument named `foo` - --> $DIR/format-args-capture-macro-hygiene.rs:4:13 + --> $DIR/format-args-capture-macro-hygiene.rs:2:13 | LL | format!(concat!("{foo}")); | ^^^^^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | format!(concat!("{foo}")); = note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info) error: there is no argument named `bar` - --> $DIR/format-args-capture-macro-hygiene.rs:5:13 + --> $DIR/format-args-capture-macro-hygiene.rs:3:13 | LL | format!(concat!("{ba", "r} {}"), 1); | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/fmt/format-args-capture-missing-variables.stderr b/src/test/ui/fmt/format-args-capture-missing-variables.stderr index ec2faa4185b..d53c206003f 100644 --- a/src/test/ui/fmt/format-args-capture-missing-variables.stderr +++ b/src/test/ui/fmt/format-args-capture-missing-variables.stderr @@ -1,5 +1,5 @@ error: named argument never used - --> $DIR/format-args-capture-missing-variables.rs:10:51 + --> $DIR/format-args-capture-missing-variables.rs:8:51 | LL | format!("{valuea} {valueb}", valuea=5, valuec=7); | ------------------- ^ named argument never used @@ -7,37 +7,37 @@ LL | format!("{valuea} {valueb}", valuea=5, valuec=7); | formatting specifier missing error[E0425]: cannot find value `foo` in this scope - --> $DIR/format-args-capture-missing-variables.rs:4:17 + --> $DIR/format-args-capture-missing-variables.rs:2:17 | LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); | ^^^^^ not found in this scope error[E0425]: cannot find value `bar` in this scope - --> $DIR/format-args-capture-missing-variables.rs:4:26 + --> $DIR/format-args-capture-missing-variables.rs:2:26 | LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); | ^^^^^ not found in this scope error[E0425]: cannot find value `foo` in this scope - --> $DIR/format-args-capture-missing-variables.rs:8:14 + --> $DIR/format-args-capture-missing-variables.rs:6:14 | LL | format!("{foo}"); | ^^^^^ not found in this scope error[E0425]: cannot find value `valueb` in this scope - --> $DIR/format-args-capture-missing-variables.rs:10:23 + --> $DIR/format-args-capture-missing-variables.rs:8:23 | LL | format!("{valuea} {valueb}", valuea=5, valuec=7); | ^^^^^^^^ not found in this scope error[E0425]: cannot find value `foo` in this scope - --> $DIR/format-args-capture-missing-variables.rs:16:9 + --> $DIR/format-args-capture-missing-variables.rs:14:9 | LL | {foo} | ^^^^^ not found in this scope error[E0425]: cannot find value `foo` in this scope - --> $DIR/format-args-capture-missing-variables.rs:21:13 + --> $DIR/format-args-capture-missing-variables.rs:19:13 | LL | panic!("{foo} {bar}", bar=1); | ^^^^^ not found in this scope diff --git a/src/test/ui/fmt/ifmt-bad-arg.rs b/src/test/ui/fmt/ifmt-bad-arg.rs index a0b0a8fb985..b3e54ed32aa 100644 --- a/src/test/ui/fmt/ifmt-bad-arg.rs +++ b/src/test/ui/fmt/ifmt-bad-arg.rs @@ -25,10 +25,10 @@ fn main() { //~^ ERROR: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments) format!("{} {foo} {} {bar} {}", 1, 2, 3); - //~^ ERROR: there is no argument named `foo` - //~^^ ERROR: there is no argument named `bar` + //~^ ERROR: cannot find value `foo` in this scope + //~^^ ERROR: cannot find value `bar` in this scope - format!("{foo}"); //~ ERROR: no argument named `foo` + format!("{foo}"); //~ ERROR: cannot find value `foo` in this scope format!("", 1, 2); //~ ERROR: multiple unused formatting arguments format!("{}", 1, 2); //~ ERROR: argument never used format!("{1}", 1, 2); //~ ERROR: argument never used @@ -43,7 +43,7 @@ fn main() { // bad named arguments, #35082 format!("{valuea} {valueb}", valuea=5, valuec=7); - //~^ ERROR there is no argument named `valueb` + //~^ ERROR cannot find value `valueb` in this scope //~^^ ERROR named argument never used // bad syntax of the format string @@ -60,7 +60,7 @@ fn main() { {foo} "##); - //~^^^ ERROR: there is no argument named `foo` + //~^^^ ERROR: cannot find value `foo` in this scope // bad syntax in format string with multiple newlines, #53836 format!("first number: {} diff --git a/src/test/ui/fmt/ifmt-bad-arg.stderr b/src/test/ui/fmt/ifmt-bad-arg.stderr index a6c7aa33e29..acc4e95f5bb 100644 --- a/src/test/ui/fmt/ifmt-bad-arg.stderr +++ b/src/test/ui/fmt/ifmt-bad-arg.stderr @@ -58,27 +58,6 @@ LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2); | = note: positional arguments are zero-based -error: there is no argument named `foo` - --> $DIR/ifmt-bad-arg.rs:27:17 - | -LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); - | ^^^^^ - | - -error: there is no argument named `bar` - --> $DIR/ifmt-bad-arg.rs:27:26 - | -LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); - | ^^^^^ - | - -error: there is no argument named `foo` - --> $DIR/ifmt-bad-arg.rs:31:14 - | -LL | format!("{foo}"); - | ^^^^^ - | - error: multiple unused formatting arguments --> $DIR/ifmt-bad-arg.rs:32:17 | @@ -153,13 +132,6 @@ LL | format!("{foo} {} {}", foo=1, 2); | | | named argument -error: there is no argument named `valueb` - --> $DIR/ifmt-bad-arg.rs:45:23 - | -LL | format!("{valuea} {valueb}", valuea=5, valuec=7); - | ^^^^^^^^ - | - error: named argument never used --> $DIR/ifmt-bad-arg.rs:45:51 | @@ -204,13 +176,6 @@ LL | format!("foo %s baz", "bar"); | = note: printf formatting not supported; see the documentation for `std::fmt` -error: there is no argument named `foo` - --> $DIR/ifmt-bad-arg.rs:60:9 - | -LL | {foo} - | ^^^^^ - | - error: invalid format string: expected `'}'`, found `'t'` --> $DIR/ifmt-bad-arg.rs:75:1 | @@ -297,6 +262,36 @@ 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[E0425]: cannot find value `foo` in this scope + --> $DIR/ifmt-bad-arg.rs:27:17 + | +LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); + | ^^^^^ not found in this scope + +error[E0425]: cannot find value `bar` in this scope + --> $DIR/ifmt-bad-arg.rs:27:26 + | +LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); + | ^^^^^ not found in this scope + +error[E0425]: cannot find value `foo` in this scope + --> $DIR/ifmt-bad-arg.rs:31:14 + | +LL | format!("{foo}"); + | ^^^^^ not found in this scope + +error[E0425]: cannot find value `valueb` in this scope + --> $DIR/ifmt-bad-arg.rs:45:23 + | +LL | format!("{valuea} {valueb}", valuea=5, valuec=7); + | ^^^^^^^^ not found in this scope + +error[E0425]: cannot find value `foo` in this scope + --> $DIR/ifmt-bad-arg.rs:60:9 + | +LL | {foo} + | ^^^^^ not found in this scope + error[E0308]: mismatched types --> $DIR/ifmt-bad-arg.rs:78:32 | @@ -319,4 +314,5 @@ LL | println!("{} {:07$.*} {}", 1, 3.2, 4); error: aborting due to 36 previous errors -For more information about this error, try `rustc --explain E0308`. +Some errors have detailed explanations: E0308, E0425. +For more information about an error, try `rustc --explain E0308`.