diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/fmt/feature-gate-format-args-capture.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/fmt/feature-gate-format-args-capture.stderr | 18 | ||||
| -rw-r--r-- | src/test/ui/fmt/format-args-capture-macro-hygiene.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/fmt/format-args-capture-macro-hygiene.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/fmt/format-args-capture-missing-variables.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/fmt/format-args-capture-missing-variables.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/fmt/format-args-capture.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/fmt/ifmt-bad-arg.rs | 10 | ||||
| -rw-r--r-- | src/test/ui/fmt/ifmt-bad-arg.stderr | 73 |
9 files changed, 46 insertions, 84 deletions
diff --git a/src/test/ui/fmt/feature-gate-format-args-capture.rs b/src/test/ui/fmt/feature-gate-format-args-capture.rs deleted file mode 100644 index 21af9161091..00000000000 --- a/src/test/ui/fmt/feature-gate-format-args-capture.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - format!("{foo}"); //~ ERROR: there is no argument named `foo` - - // panic! doesn't hit format_args! unless there are two or more arguments. - panic!("{foo} {bar}", bar=1); //~ ERROR: there is no argument named `foo` -} diff --git a/src/test/ui/fmt/feature-gate-format-args-capture.stderr b/src/test/ui/fmt/feature-gate-format-args-capture.stderr deleted file mode 100644 index f08f1651cb6..00000000000 --- a/src/test/ui/fmt/feature-gate-format-args-capture.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: there is no argument named `foo` - --> $DIR/feature-gate-format-args-capture.rs:2:14 - | -LL | format!("{foo}"); - | ^^^^^ - | - = help: if you intended to capture `foo` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes - -error: there is no argument named `foo` - --> $DIR/feature-gate-format-args-capture.rs:5:13 - | -LL | panic!("{foo} {bar}", bar=1); - | ^^^^^ - | - = help: if you intended to capture `foo` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/fmt/format-args-capture-macro-hygiene.rs b/src/test/ui/fmt/format-args-capture-macro-hygiene.rs index 6ca7dcc216f..fdbd93836ef 100644 --- a/src/test/ui/fmt/format-args-capture-macro-hygiene.rs +++ b/src/test/ui/fmt/format-args-capture-macro-hygiene.rs @@ -1,5 +1,3 @@ -#![feature(format_args_capture)] - fn main() { format!(concat!("{foo}")); //~ ERROR: there is no argument named `foo` format!(concat!("{ba", "r} {}"), 1); //~ ERROR: there is no argument named `bar` 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.rs b/src/test/ui/fmt/format-args-capture-missing-variables.rs index 3a4b6144b04..46fc083cb73 100644 --- a/src/test/ui/fmt/format-args-capture-missing-variables.rs +++ b/src/test/ui/fmt/format-args-capture-missing-variables.rs @@ -1,5 +1,3 @@ -#![feature(format_args_capture)] - fn main() { format!("{} {foo} {} {bar} {}", 1, 2, 3); //~^ ERROR: cannot find value `foo` in this scope 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/format-args-capture.rs b/src/test/ui/fmt/format-args-capture.rs index b30e9a47a13..e830a5bc9c5 100644 --- a/src/test/ui/fmt/format-args-capture.rs +++ b/src/test/ui/fmt/format-args-capture.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(format_args_capture)] #![feature(cfg_panic)] fn main() { 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 f4c84e22faa..acc4e95f5bb 100644 --- a/src/test/ui/fmt/ifmt-bad-arg.stderr +++ b/src/test/ui/fmt/ifmt-bad-arg.stderr @@ -58,30 +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); - | ^^^^^ - | - = help: if you intended to capture `foo` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes - -error: there is no argument named `bar` - --> $DIR/ifmt-bad-arg.rs:27:26 - | -LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); - | ^^^^^ - | - = help: if you intended to capture `bar` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes - -error: there is no argument named `foo` - --> $DIR/ifmt-bad-arg.rs:31:14 - | -LL | format!("{foo}"); - | ^^^^^ - | - = help: if you intended to capture `foo` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes - error: multiple unused formatting arguments --> $DIR/ifmt-bad-arg.rs:32:17 | @@ -156,14 +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); - | ^^^^^^^^ - | - = help: if you intended to capture `valueb` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes - error: named argument never used --> $DIR/ifmt-bad-arg.rs:45:51 | @@ -208,14 +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} - | ^^^^^ - | - = help: if you intended to capture `foo` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes - error: invalid format string: expected `'}'`, found `'t'` --> $DIR/ifmt-bad-arg.rs:75:1 | @@ -302,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 | @@ -324,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`. |
