Skip to content

Commit afa719e

Browse files
committed
Update test output
1 parent 8c9bfaa commit afa719e

4 files changed

+46
-50
lines changed

src/test/ui/fmt/format-args-capture-macro-hygiene.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: there is no argument named `foo`
2-
--> $DIR/format-args-capture-macro-hygiene.rs:4:13
2+
--> $DIR/format-args-capture-macro-hygiene.rs:2:13
33
|
44
LL | format!(concat!("{foo}"));
55
| ^^^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | format!(concat!("{foo}"));
99
= note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
1010

1111
error: there is no argument named `bar`
12-
--> $DIR/format-args-capture-macro-hygiene.rs:5:13
12+
--> $DIR/format-args-capture-macro-hygiene.rs:3:13
1313
|
1414
LL | format!(concat!("{ba", "r} {}"), 1);
1515
| ^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/fmt/format-args-capture-missing-variables.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
error: named argument never used
2-
--> $DIR/format-args-capture-missing-variables.rs:10:51
2+
--> $DIR/format-args-capture-missing-variables.rs:8:51
33
|
44
LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
55
| ------------------- ^ named argument never used
66
| |
77
| formatting specifier missing
88

99
error[E0425]: cannot find value `foo` in this scope
10-
--> $DIR/format-args-capture-missing-variables.rs:4:17
10+
--> $DIR/format-args-capture-missing-variables.rs:2:17
1111
|
1212
LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
1313
| ^^^^^ not found in this scope
1414

1515
error[E0425]: cannot find value `bar` in this scope
16-
--> $DIR/format-args-capture-missing-variables.rs:4:26
16+
--> $DIR/format-args-capture-missing-variables.rs:2:26
1717
|
1818
LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
1919
| ^^^^^ not found in this scope
2020

2121
error[E0425]: cannot find value `foo` in this scope
22-
--> $DIR/format-args-capture-missing-variables.rs:8:14
22+
--> $DIR/format-args-capture-missing-variables.rs:6:14
2323
|
2424
LL | format!("{foo}");
2525
| ^^^^^ not found in this scope
2626

2727
error[E0425]: cannot find value `valueb` in this scope
28-
--> $DIR/format-args-capture-missing-variables.rs:10:23
28+
--> $DIR/format-args-capture-missing-variables.rs:8:23
2929
|
3030
LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
3131
| ^^^^^^^^ not found in this scope
3232

3333
error[E0425]: cannot find value `foo` in this scope
34-
--> $DIR/format-args-capture-missing-variables.rs:16:9
34+
--> $DIR/format-args-capture-missing-variables.rs:14:9
3535
|
3636
LL | {foo}
3737
| ^^^^^ not found in this scope
3838

3939
error[E0425]: cannot find value `foo` in this scope
40-
--> $DIR/format-args-capture-missing-variables.rs:21:13
40+
--> $DIR/format-args-capture-missing-variables.rs:19:13
4141
|
4242
LL | panic!("{foo} {bar}", bar=1);
4343
| ^^^^^ not found in this scope

src/test/ui/fmt/ifmt-bad-arg.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ fn main() {
2525
//~^ ERROR: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments)
2626

2727
format!("{} {foo} {} {bar} {}", 1, 2, 3);
28-
//~^ ERROR: there is no argument named `foo`
29-
//~^^ ERROR: there is no argument named `bar`
28+
//~^ ERROR: cannot find value `foo` in this scope
29+
//~^^ ERROR: cannot find value `bar` in this scope
3030

31-
format!("{foo}"); //~ ERROR: no argument named `foo`
31+
format!("{foo}"); //~ ERROR: cannot find value `foo` in this scope
3232
format!("", 1, 2); //~ ERROR: multiple unused formatting arguments
3333
format!("{}", 1, 2); //~ ERROR: argument never used
3434
format!("{1}", 1, 2); //~ ERROR: argument never used
@@ -43,7 +43,7 @@ fn main() {
4343
// bad named arguments, #35082
4444

4545
format!("{valuea} {valueb}", valuea=5, valuec=7);
46-
//~^ ERROR there is no argument named `valueb`
46+
//~^ ERROR cannot find value `valueb` in this scope
4747
//~^^ ERROR named argument never used
4848

4949
// bad syntax of the format string
@@ -60,7 +60,7 @@ fn main() {
6060
{foo}
6161
6262
"##);
63-
//~^^^ ERROR: there is no argument named `foo`
63+
//~^^^ ERROR: cannot find value `foo` in this scope
6464

6565
// bad syntax in format string with multiple newlines, #53836
6666
format!("first number: {}

src/test/ui/fmt/ifmt-bad-arg.stderr

+32-36
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,6 @@ LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2);
5858
|
5959
= note: positional arguments are zero-based
6060

61-
error: there is no argument named `foo`
62-
--> $DIR/ifmt-bad-arg.rs:27:17
63-
|
64-
LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
65-
| ^^^^^
66-
|
67-
68-
error: there is no argument named `bar`
69-
--> $DIR/ifmt-bad-arg.rs:27:26
70-
|
71-
LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
72-
| ^^^^^
73-
|
74-
75-
error: there is no argument named `foo`
76-
--> $DIR/ifmt-bad-arg.rs:31:14
77-
|
78-
LL | format!("{foo}");
79-
| ^^^^^
80-
|
81-
8261
error: multiple unused formatting arguments
8362
--> $DIR/ifmt-bad-arg.rs:32:17
8463
|
@@ -153,13 +132,6 @@ LL | format!("{foo} {} {}", foo=1, 2);
153132
| |
154133
| named argument
155134

156-
error: there is no argument named `valueb`
157-
--> $DIR/ifmt-bad-arg.rs:45:23
158-
|
159-
LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
160-
| ^^^^^^^^
161-
|
162-
163135
error: named argument never used
164136
--> $DIR/ifmt-bad-arg.rs:45:51
165137
|
@@ -204,13 +176,6 @@ LL | format!("foo %s baz", "bar");
204176
|
205177
= note: printf formatting not supported; see the documentation for `std::fmt`
206178

207-
error: there is no argument named `foo`
208-
--> $DIR/ifmt-bad-arg.rs:60:9
209-
|
210-
LL | {foo}
211-
| ^^^^^
212-
|
213-
214179
error: invalid format string: expected `'}'`, found `'t'`
215180
--> $DIR/ifmt-bad-arg.rs:75:1
216181
|
@@ -297,6 +262,36 @@ LL | println!("{:.*}");
297262
= note: positional arguments are zero-based
298263
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
299264

265+
error[E0425]: cannot find value `foo` in this scope
266+
--> $DIR/ifmt-bad-arg.rs:27:17
267+
|
268+
LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
269+
| ^^^^^ not found in this scope
270+
271+
error[E0425]: cannot find value `bar` in this scope
272+
--> $DIR/ifmt-bad-arg.rs:27:26
273+
|
274+
LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
275+
| ^^^^^ not found in this scope
276+
277+
error[E0425]: cannot find value `foo` in this scope
278+
--> $DIR/ifmt-bad-arg.rs:31:14
279+
|
280+
LL | format!("{foo}");
281+
| ^^^^^ not found in this scope
282+
283+
error[E0425]: cannot find value `valueb` in this scope
284+
--> $DIR/ifmt-bad-arg.rs:45:23
285+
|
286+
LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
287+
| ^^^^^^^^ not found in this scope
288+
289+
error[E0425]: cannot find value `foo` in this scope
290+
--> $DIR/ifmt-bad-arg.rs:60:9
291+
|
292+
LL | {foo}
293+
| ^^^^^ not found in this scope
294+
300295
error[E0308]: mismatched types
301296
--> $DIR/ifmt-bad-arg.rs:78:32
302297
|
@@ -319,4 +314,5 @@ LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
319314

320315
error: aborting due to 36 previous errors
321316

322-
For more information about this error, try `rustc --explain E0308`.
317+
Some errors have detailed explanations: E0308, E0425.
318+
For more information about an error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)