@@ -16,24 +16,32 @@ LL | println!("}");
1616 |
1717 = note: if you intended to print `}`, you can escape it using `}}`
1818
19- error: invalid format string: invalid argument name `_foo `
19+ error: invalid format string: invalid argument name `_ `
2020 --> $DIR/format-string-error.rs:9:23
2121 |
22- LL | let _ = format!("{_foo }", _foo = 6usize);
23- | ^^^^ invalid argument name in format string
22+ LL | let _ = format!("{_ }", _ = 6usize);
23+ | ^ invalid argument name in format string
2424 |
25- = note: argument names cannot start with an underscore
25+ = note: argument name cannot be a single underscore
2626
2727error: invalid format string: invalid argument name `_`
28- --> $DIR/format-string-error.rs:11:23
28+ --> $DIR/format-string-error.rs:11:25
2929 |
30- LL | let _ = format!("{_}", _ = 6usize);
31- | ^ invalid argument name in format string
30+ LL | let _ = format!("{a:_}", a = "", _ = 0);
31+ | ^ invalid argument name in format string
32+ |
33+ = note: argument name cannot be a single underscore
34+
35+ error: invalid format string: invalid argument name `_`
36+ --> $DIR/format-string-error.rs:13:26
37+ |
38+ LL | let _ = format!("{a:._$}", a = "", _ = 0);
39+ | ^ invalid argument name in format string
3240 |
33- = note: argument names cannot start with an underscore
41+ = note: argument name cannot be a single underscore
3442
3543error: invalid format string: expected `'}'` but string was terminated
36- --> $DIR/format-string-error.rs:13 :23
44+ --> $DIR/format-string-error.rs:15 :23
3745 |
3846LL | let _ = format!("{");
3947 | -^ expected `'}'` in format string
@@ -43,15 +51,15 @@ LL | let _ = format!("{");
4351 = note: if you intended to print `{`, you can escape it using `{{`
4452
4553error: invalid format string: unmatched `}` found
46- --> $DIR/format-string-error.rs:15 :22
54+ --> $DIR/format-string-error.rs:17 :22
4755 |
4856LL | let _ = format!("}");
4957 | ^ unmatched `}` in format string
5058 |
5159 = note: if you intended to print `}`, you can escape it using `}}`
5260
5361error: invalid format string: expected `'}'`, found `'\'`
54- --> $DIR/format-string-error.rs:17 :23
62+ --> $DIR/format-string-error.rs:19 :23
5563 |
5664LL | let _ = format!("{\}");
5765 | -^ expected `}` in format string
@@ -61,7 +69,7 @@ LL | let _ = format!("{\}");
6169 = note: if you intended to print `{`, you can escape it using `{{`
6270
6371error: invalid format string: expected `'}'` but string was terminated
64- --> $DIR/format-string-error.rs:19 :35
72+ --> $DIR/format-string-error.rs:21 :35
6573 |
6674LL | let _ = format!("\n\n\n{\n\n\n");
6775 | - ^ expected `'}'` in format string
@@ -71,7 +79,7 @@ LL | let _ = format!("\n\n\n{\n\n\n");
7179 = note: if you intended to print `{`, you can escape it using `{{`
7280
7381error: invalid format string: expected `'}'` but string was terminated
74- --> $DIR/format-string-error.rs:25 :3
82+ --> $DIR/format-string-error.rs:27 :3
7583 |
7684LL | {"###);
7785 | -^ expected `'}'` in format string
@@ -81,7 +89,7 @@ LL | {"###);
8189 = note: if you intended to print `{`, you can escape it using `{{`
8290
8391error: invalid format string: expected `'}'` but string was terminated
84- --> $DIR/format-string-error.rs:33 :1
92+ --> $DIR/format-string-error.rs:35 :1
8593 |
8694LL | {
8795 | - because of this opening brace
@@ -92,26 +100,26 @@ LL | "###);
92100 = note: if you intended to print `{`, you can escape it using `{{`
93101
94102error: invalid format string: unmatched `}` found
95- --> $DIR/format-string-error.rs:39 :2
103+ --> $DIR/format-string-error.rs:41 :2
96104 |
97105LL | }
98106 | ^ unmatched `}` in format string
99107 |
100108 = note: if you intended to print `}`, you can escape it using `}}`
101109
102110error: invalid format string: unmatched `}` found
103- --> $DIR/format-string-error.rs:47 :9
111+ --> $DIR/format-string-error.rs:49 :9
104112 |
105113LL | }
106114 | ^ unmatched `}` in format string
107115 |
108116 = note: if you intended to print `}`, you can escape it using `}}`
109117
110118error: 3 positional arguments in format string, but there are 2 arguments
111- --> $DIR/format-string-error.rs:51 :15
119+ --> $DIR/format-string-error.rs:53 :15
112120 |
113121LL | println!("{} {} {}", 1, 2);
114122 | ^^ ^^ ^^ - -
115123
116- error: aborting due to 13 previous errors
124+ error: aborting due to 14 previous errors
117125
0 commit comments