]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/format-parse-errors.stderr
Rollup merge of #106958 - jyn514:labels, r=m-ou-se
[rust.git] / tests / ui / macros / format-parse-errors.stderr
1 error: requires at least a format string argument
2   --> $DIR/format-parse-errors.rs:4:5
3    |
4 LL |     format!();
5    |     ^^^^^^^^^
6    |
7    = note: this error originates in the macro `$crate::__export::format_args` which comes from the expansion of the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
8
9 error: expected expression, found keyword `struct`
10   --> $DIR/format-parse-errors.rs:5:13
11    |
12 LL |     format!(struct);
13    |             ^^^^^^ expected expression
14
15 error: expected expression, found end of macro arguments
16   --> $DIR/format-parse-errors.rs:6:24
17    |
18 LL |     format!("s", name =);
19    |                        ^ expected expression
20
21 error: positional arguments cannot follow named arguments
22   --> $DIR/format-parse-errors.rs:10:9
23    |
24 LL |         foo = foo,
25    |         --------- named argument
26 LL |         bar,
27    |         ^^^ positional arguments must be before named arguments
28
29 error: expected expression, found keyword `struct`
30   --> $DIR/format-parse-errors.rs:12:30
31    |
32 LL |     format!("s {foo}", foo = struct);
33    |                              ^^^^^^ expected expression
34
35 error: expected expression, found keyword `struct`
36   --> $DIR/format-parse-errors.rs:13:18
37    |
38 LL |     format!("s", struct);
39    |                  ^^^^^^ expected expression
40
41 error: format argument must be a string literal
42   --> $DIR/format-parse-errors.rs:16:13
43    |
44 LL |     format!(123);
45    |             ^^^
46    |
47 help: you might be missing a string literal to format with
48    |
49 LL |     format!("{}", 123);
50    |             +++++
51
52 error: aborting due to 7 previous errors
53