@@ -16,24 +16,32 @@ LL | println!("}");
16
16
|
17
17
= note: if you intended to print `}`, you can escape it using `}}`
18
18
19
- error: invalid format string: invalid argument name `_foo `
19
+ error: invalid format string: invalid argument name `_ `
20
20
--> $DIR/format-string-error.rs:9:23
21
21
|
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
24
24
|
25
- = note: argument names cannot start with an underscore
25
+ = note: argument name cannot be a single underscore
26
26
27
27
error: invalid format string: invalid argument name `_`
28
- --> $DIR/format-string-error.rs:11:23
28
+ --> $DIR/format-string-error.rs:11:25
29
29
|
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
32
40
|
33
- = note: argument names cannot start with an underscore
41
+ = note: argument name cannot be a single underscore
34
42
35
43
error: invalid format string: expected `'}'` but string was terminated
36
- --> $DIR/format-string-error.rs:13 :23
44
+ --> $DIR/format-string-error.rs:15 :23
37
45
|
38
46
LL | let _ = format!("{");
39
47
| -^ expected `'}'` in format string
@@ -43,15 +51,15 @@ LL | let _ = format!("{");
43
51
= note: if you intended to print `{`, you can escape it using `{{`
44
52
45
53
error: invalid format string: unmatched `}` found
46
- --> $DIR/format-string-error.rs:15 :22
54
+ --> $DIR/format-string-error.rs:17 :22
47
55
|
48
56
LL | let _ = format!("}");
49
57
| ^ unmatched `}` in format string
50
58
|
51
59
= note: if you intended to print `}`, you can escape it using `}}`
52
60
53
61
error: invalid format string: expected `'}'`, found `'\'`
54
- --> $DIR/format-string-error.rs:17 :23
62
+ --> $DIR/format-string-error.rs:19 :23
55
63
|
56
64
LL | let _ = format!("{\}");
57
65
| -^ expected `}` in format string
@@ -61,7 +69,7 @@ LL | let _ = format!("{\}");
61
69
= note: if you intended to print `{`, you can escape it using `{{`
62
70
63
71
error: invalid format string: expected `'}'` but string was terminated
64
- --> $DIR/format-string-error.rs:19 :35
72
+ --> $DIR/format-string-error.rs:21 :35
65
73
|
66
74
LL | let _ = format!("\n\n\n{\n\n\n");
67
75
| - ^ expected `'}'` in format string
@@ -71,7 +79,7 @@ LL | let _ = format!("\n\n\n{\n\n\n");
71
79
= note: if you intended to print `{`, you can escape it using `{{`
72
80
73
81
error: invalid format string: expected `'}'` but string was terminated
74
- --> $DIR/format-string-error.rs:25 :3
82
+ --> $DIR/format-string-error.rs:27 :3
75
83
|
76
84
LL | {"###);
77
85
| -^ expected `'}'` in format string
@@ -81,7 +89,7 @@ LL | {"###);
81
89
= note: if you intended to print `{`, you can escape it using `{{`
82
90
83
91
error: invalid format string: expected `'}'` but string was terminated
84
- --> $DIR/format-string-error.rs:33 :1
92
+ --> $DIR/format-string-error.rs:35 :1
85
93
|
86
94
LL | {
87
95
| - because of this opening brace
@@ -92,26 +100,26 @@ LL | "###);
92
100
= note: if you intended to print `{`, you can escape it using `{{`
93
101
94
102
error: invalid format string: unmatched `}` found
95
- --> $DIR/format-string-error.rs:39 :2
103
+ --> $DIR/format-string-error.rs:41 :2
96
104
|
97
105
LL | }
98
106
| ^ unmatched `}` in format string
99
107
|
100
108
= note: if you intended to print `}`, you can escape it using `}}`
101
109
102
110
error: invalid format string: unmatched `}` found
103
- --> $DIR/format-string-error.rs:47 :9
111
+ --> $DIR/format-string-error.rs:49 :9
104
112
|
105
113
LL | }
106
114
| ^ unmatched `}` in format string
107
115
|
108
116
= note: if you intended to print `}`, you can escape it using `}}`
109
117
110
118
error: 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
112
120
|
113
121
LL | println!("{} {} {}", 1, 2);
114
122
| ^^ ^^ ^^ - -
115
123
116
- error: aborting due to 13 previous errors
124
+ error: aborting due to 14 previous errors
117
125
0 commit comments