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