]> git.proxmox.com Git - rustc.git/blame - src/test/ui/if/ifmt-bad-arg.stderr
New upstream version 1.37.0+dfsg1
[rustc.git] / src / test / ui / if / ifmt-bad-arg.stderr
CommitLineData
8faf50e0 1error: 1 positional argument in format string, but no arguments were given
0731742a 2 --> $DIR/ifmt-bad-arg.rs:6:14
8faf50e0
XL
3 |
4LL | format!("{}");
5 | ^^
6
7error: invalid reference to positional argument 1 (there is 1 argument)
0731742a 8 --> $DIR/ifmt-bad-arg.rs:9:14
8faf50e0
XL
9 |
10LL | format!("{1}", 1);
11 | ^^^
12 |
13 = note: positional arguments are zero-based
14
15error: argument never used
0731742a 16 --> $DIR/ifmt-bad-arg.rs:9:20
8faf50e0
XL
17 |
18LL | format!("{1}", 1);
0731742a 19 | ----- ^ argument never used
8faf50e0
XL
20 | |
21 | formatting specifier missing
22
23error: 2 positional arguments in format string, but no arguments were given
0731742a 24 --> $DIR/ifmt-bad-arg.rs:13:14
8faf50e0
XL
25 |
26LL | format!("{} {}");
27 | ^^ ^^
28
29error: invalid reference to positional argument 1 (there is 1 argument)
0731742a 30 --> $DIR/ifmt-bad-arg.rs:16:18
8faf50e0
XL
31 |
32LL | format!("{0} {1}", 1);
33 | ^^^
34 |
35 = note: positional arguments are zero-based
36
37error: invalid reference to positional argument 2 (there are 2 arguments)
0731742a 38 --> $DIR/ifmt-bad-arg.rs:19:22
8faf50e0
XL
39 |
40LL | format!("{0} {1} {2}", 1, 2);
41 | ^^^
42 |
43 = note: positional arguments are zero-based
44
45error: invalid reference to positional argument 2 (there are 2 arguments)
0731742a 46 --> $DIR/ifmt-bad-arg.rs:22:28
8faf50e0
XL
47 |
48LL | format!("{} {value} {} {}", 1, value=2);
49 | ^^
50 |
51 = note: positional arguments are zero-based
52
53error: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments)
0731742a 54 --> $DIR/ifmt-bad-arg.rs:24:38
8faf50e0
XL
55 |
56LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2);
57 | ^^ ^^ ^^
58 |
59 = note: positional arguments are zero-based
60
61error: there is no argument named `foo`
0731742a 62 --> $DIR/ifmt-bad-arg.rs:27:17
8faf50e0
XL
63 |
64LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
65 | ^^^^^
66
67error: there is no argument named `bar`
0731742a 68 --> $DIR/ifmt-bad-arg.rs:27:26
8faf50e0
XL
69 |
70LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
71 | ^^^^^
72
73error: there is no argument named `foo`
0731742a 74 --> $DIR/ifmt-bad-arg.rs:31:14
8faf50e0 75 |
532ac7d7 76LL | format!("{foo}");
8faf50e0
XL
77 | ^^^^^
78
79error: multiple unused formatting arguments
0731742a 80 --> $DIR/ifmt-bad-arg.rs:32:17
8faf50e0 81 |
532ac7d7 82LL | format!("", 1, 2);
0731742a
XL
83 | -- ^ ^ argument never used
84 | | |
85 | | argument never used
8faf50e0
XL
86 | multiple missing formatting specifiers
87
88error: argument never used
0731742a 89 --> $DIR/ifmt-bad-arg.rs:33:22
8faf50e0 90 |
532ac7d7 91LL | format!("{}", 1, 2);
0731742a 92 | ---- ^ argument never used
8faf50e0
XL
93 | |
94 | formatting specifier missing
95
96error: argument never used
0731742a 97 --> $DIR/ifmt-bad-arg.rs:34:20
8faf50e0 98 |
532ac7d7 99LL | format!("{1}", 1, 2);
0731742a 100 | ----- ^ argument never used
8faf50e0
XL
101 | |
102 | formatting specifier missing
103
104error: named argument never used
0731742a 105 --> $DIR/ifmt-bad-arg.rs:35:26
8faf50e0 106 |
532ac7d7 107LL | format!("{}", 1, foo=2);
0731742a 108 | ---- ^ named argument never used
8faf50e0
XL
109 | |
110 | formatting specifier missing
111
112error: argument never used
0731742a 113 --> $DIR/ifmt-bad-arg.rs:36:22
8faf50e0 114 |
532ac7d7 115LL | format!("{foo}", 1, foo=2);
0731742a 116 | ------- ^ argument never used
8faf50e0
XL
117 | |
118 | formatting specifier missing
119
120error: named argument never used
0731742a 121 --> $DIR/ifmt-bad-arg.rs:37:21
8faf50e0 122 |
532ac7d7 123LL | format!("", foo=2);
0731742a 124 | -- ^ named argument never used
8faf50e0
XL
125 | |
126 | formatting specifier missing
127
128error: multiple unused formatting arguments
0731742a 129 --> $DIR/ifmt-bad-arg.rs:38:32
8faf50e0 130 |
532ac7d7 131LL | format!("{} {}", 1, 2, foo=1, bar=2);
0731742a
XL
132 | ------- ^ ^ named argument never used
133 | | |
134 | | named argument never used
8faf50e0
XL
135 | multiple missing formatting specifiers
136
137error: duplicate argument named `foo`
0731742a 138 --> $DIR/ifmt-bad-arg.rs:40:33
8faf50e0 139 |
532ac7d7 140LL | format!("{foo}", foo=1, foo=2);
8faf50e0
XL
141 | ^
142 |
143note: previously here
0731742a 144 --> $DIR/ifmt-bad-arg.rs:40:26
8faf50e0 145 |
532ac7d7 146LL | format!("{foo}", foo=1, foo=2);
8faf50e0
XL
147 | ^
148
149error: expected ident, positional arguments cannot follow named arguments
0731742a 150 --> $DIR/ifmt-bad-arg.rs:41:24
8faf50e0 151 |
532ac7d7 152LL | format!("", foo=1, 2);
8faf50e0
XL
153 | ^
154
155error: there is no argument named `valueb`
0731742a 156 --> $DIR/ifmt-bad-arg.rs:45:23
8faf50e0
XL
157 |
158LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
159 | ^^^^^^^^
160
161error: named argument never used
0731742a 162 --> $DIR/ifmt-bad-arg.rs:45:51
8faf50e0
XL
163 |
164LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
0731742a 165 | ------------------- ^ named argument never used
8faf50e0
XL
166 | |
167 | formatting specifier missing
168
169error: invalid format string: expected `'}'` but string was terminated
0731742a 170 --> $DIR/ifmt-bad-arg.rs:51:15
8faf50e0 171 |
532ac7d7 172LL | format!("{");
0731742a
XL
173 | -^ expected `'}'` in format string
174 | |
175 | because of this opening brace
8faf50e0
XL
176 |
177 = note: if you intended to print `{`, you can escape it using `{{`
178
179error: invalid format string: unmatched `}` found
0731742a 180 --> $DIR/ifmt-bad-arg.rs:53:18
8faf50e0 181 |
532ac7d7 182LL | format!("foo } bar");
8faf50e0
XL
183 | ^ unmatched `}` in format string
184 |
185 = note: if you intended to print `}`, you can escape it using `}}`
186
187error: invalid format string: unmatched `}` found
0731742a 188 --> $DIR/ifmt-bad-arg.rs:54:18
8faf50e0 189 |
532ac7d7 190LL | format!("foo }");
8faf50e0
XL
191 | ^ unmatched `}` in format string
192 |
193 = note: if you intended to print `}`, you can escape it using `}}`
194
195error: argument never used
0731742a 196 --> $DIR/ifmt-bad-arg.rs:56:27
8faf50e0 197 |
532ac7d7 198LL | format!("foo %s baz", "bar");
0731742a 199 | -- ^^^^^ argument never used
8faf50e0
XL
200 | |
201 | help: format specifiers use curly braces: `{}`
202 |
203 = note: printf formatting not supported; see the documentation for `std::fmt`
204
205error: there is no argument named `foo`
0731742a 206 --> $DIR/ifmt-bad-arg.rs:60:9
8faf50e0
XL
207 |
208LL | {foo}
209 | ^^^^^
210
0bf4aa26 211error: invalid format string: expected `'}'`, found `'t'`
0731742a 212 --> $DIR/ifmt-bad-arg.rs:75:1
0bf4aa26 213 |
0731742a
XL
214LL | ninth number: {
215 | - because of this opening brace
0bf4aa26
XL
216LL | tenth number: {}",
217 | ^ expected `}` in format string
0731742a
XL
218 |
219 = note: if you intended to print `{`, you can escape it using `{{`
0bf4aa26
XL
220
221error: aborting due to 28 previous errors
8faf50e0 222