Skip to content

Commit 7d990a8

Browse files
committed
Bless tests.
1 parent 865d0fe commit 7d990a8

File tree

2 files changed

+225
-67
lines changed

2 files changed

+225
-67
lines changed

src/test/ui/const-generics/const-arg-in-const-arg.min.stderr

+212-63
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,8 @@ LL | let _: [u8; bar::<N>()];
1616
= help: const parameters may only be used as standalone arguments, i.e. `N`
1717
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
1818

19-
error: generic parameters may not be used in const operations
20-
--> $DIR/const-arg-in-const-arg.rs:24:23
21-
|
22-
LL | let _ = [0; bar::<N>()];
23-
| ^ cannot perform const operation using `N`
24-
|
25-
= help: const parameters may only be used as standalone arguments, i.e. `N`
26-
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
27-
28-
error: generic parameters may not be used in const operations
29-
--> $DIR/const-arg-in-const-arg.rs:29:24
30-
|
31-
LL | let _: Foo<{ foo::<T>() }>;
32-
| ^ cannot perform const operation using `T`
33-
|
34-
= note: type parameters may not be used in const expressions
35-
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
36-
37-
error: generic parameters may not be used in const operations
38-
--> $DIR/const-arg-in-const-arg.rs:30:24
39-
|
40-
LL | let _: Foo<{ bar::<N>() }>;
41-
| ^ cannot perform const operation using `N`
42-
|
43-
= help: const parameters may only be used as standalone arguments, i.e. `N`
44-
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
45-
46-
error: generic parameters may not be used in const operations
47-
--> $DIR/const-arg-in-const-arg.rs:35:27
48-
|
49-
LL | let _ = Foo::<{ foo::<T>() }>;
50-
| ^ cannot perform const operation using `T`
51-
|
52-
= note: type parameters may not be used in const expressions
53-
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
54-
55-
error: generic parameters may not be used in const operations
56-
--> $DIR/const-arg-in-const-arg.rs:36:27
57-
|
58-
LL | let _ = Foo::<{ bar::<N>() }>;
59-
| ^ cannot perform const operation using `N`
60-
|
61-
= help: const parameters may only be used as standalone arguments, i.e. `N`
62-
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
63-
6419
error[E0658]: a non-static lifetime is not allowed in a `const`
65-
--> $DIR/const-arg-in-const-arg.rs:15:23
20+
--> $DIR/const-arg-in-const-arg.rs:16:23
6621
|
6722
LL | let _: [u8; faz::<'a>(&())];
6823
| ^^
@@ -71,7 +26,7 @@ LL | let _: [u8; faz::<'a>(&())];
7126
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
7227

7328
error[E0658]: a non-static lifetime is not allowed in a `const`
74-
--> $DIR/const-arg-in-const-arg.rs:16:23
29+
--> $DIR/const-arg-in-const-arg.rs:18:23
7530
|
7631
LL | let _: [u8; baz::<'a>(&())];
7732
| ^^
@@ -80,7 +35,7 @@ LL | let _: [u8; baz::<'a>(&())];
8035
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
8136

8237
error[E0658]: a non-static lifetime is not allowed in a `const`
83-
--> $DIR/const-arg-in-const-arg.rs:17:23
38+
--> $DIR/const-arg-in-const-arg.rs:19:23
8439
|
8540
LL | let _: [u8; faz::<'b>(&())];
8641
| ^^
@@ -89,16 +44,25 @@ LL | let _: [u8; faz::<'b>(&())];
8944
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
9045

9146
error[E0658]: a non-static lifetime is not allowed in a `const`
92-
--> $DIR/const-arg-in-const-arg.rs:18:23
47+
--> $DIR/const-arg-in-const-arg.rs:21:23
9348
|
9449
LL | let _: [u8; baz::<'b>(&())];
9550
| ^^
9651
|
9752
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
9853
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
9954

55+
error: generic parameters may not be used in const operations
56+
--> $DIR/const-arg-in-const-arg.rs:24:23
57+
|
58+
LL | let _ = [0; bar::<N>()];
59+
| ^ cannot perform const operation using `N`
60+
|
61+
= help: const parameters may only be used as standalone arguments, i.e. `N`
62+
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
63+
10064
error[E0658]: a non-static lifetime is not allowed in a `const`
101-
--> $DIR/const-arg-in-const-arg.rs:25:23
65+
--> $DIR/const-arg-in-const-arg.rs:26:23
10266
|
10367
LL | let _ = [0; faz::<'a>(&())];
10468
| ^^
@@ -107,7 +71,7 @@ LL | let _ = [0; faz::<'a>(&())];
10771
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
10872

10973
error[E0658]: a non-static lifetime is not allowed in a `const`
110-
--> $DIR/const-arg-in-const-arg.rs:26:23
74+
--> $DIR/const-arg-in-const-arg.rs:28:23
11175
|
11276
LL | let _ = [0; baz::<'a>(&())];
11377
| ^^
@@ -116,7 +80,7 @@ LL | let _ = [0; baz::<'a>(&())];
11680
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
11781

11882
error[E0658]: a non-static lifetime is not allowed in a `const`
119-
--> $DIR/const-arg-in-const-arg.rs:27:23
83+
--> $DIR/const-arg-in-const-arg.rs:29:23
12084
|
12185
LL | let _ = [0; faz::<'b>(&())];
12286
| ^^
@@ -125,16 +89,34 @@ LL | let _ = [0; faz::<'b>(&())];
12589
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
12690

12791
error[E0658]: a non-static lifetime is not allowed in a `const`
128-
--> $DIR/const-arg-in-const-arg.rs:28:23
92+
--> $DIR/const-arg-in-const-arg.rs:31:23
12993
|
13094
LL | let _ = [0; baz::<'b>(&())];
13195
| ^^
13296
|
13397
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
13498
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
13599

100+
error: generic parameters may not be used in const operations
101+
--> $DIR/const-arg-in-const-arg.rs:32:24
102+
|
103+
LL | let _: Foo<{ foo::<T>() }>;
104+
| ^ cannot perform const operation using `T`
105+
|
106+
= note: type parameters may not be used in const expressions
107+
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
108+
109+
error: generic parameters may not be used in const operations
110+
--> $DIR/const-arg-in-const-arg.rs:33:24
111+
|
112+
LL | let _: Foo<{ bar::<N>() }>;
113+
| ^ cannot perform const operation using `N`
114+
|
115+
= help: const parameters may only be used as standalone arguments, i.e. `N`
116+
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
117+
136118
error[E0658]: a non-static lifetime is not allowed in a `const`
137-
--> $DIR/const-arg-in-const-arg.rs:31:24
119+
--> $DIR/const-arg-in-const-arg.rs:35:24
138120
|
139121
LL | let _: Foo<{ faz::<'a>(&()) }>;
140122
| ^^
@@ -143,7 +125,7 @@ LL | let _: Foo<{ faz::<'a>(&()) }>;
143125
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
144126

145127
error[E0658]: a non-static lifetime is not allowed in a `const`
146-
--> $DIR/const-arg-in-const-arg.rs:32:24
128+
--> $DIR/const-arg-in-const-arg.rs:37:24
147129
|
148130
LL | let _: Foo<{ baz::<'a>(&()) }>;
149131
| ^^
@@ -152,7 +134,7 @@ LL | let _: Foo<{ baz::<'a>(&()) }>;
152134
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
153135

154136
error[E0658]: a non-static lifetime is not allowed in a `const`
155-
--> $DIR/const-arg-in-const-arg.rs:33:24
137+
--> $DIR/const-arg-in-const-arg.rs:38:24
156138
|
157139
LL | let _: Foo<{ faz::<'b>(&()) }>;
158140
| ^^
@@ -161,16 +143,34 @@ LL | let _: Foo<{ faz::<'b>(&()) }>;
161143
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
162144

163145
error[E0658]: a non-static lifetime is not allowed in a `const`
164-
--> $DIR/const-arg-in-const-arg.rs:34:24
146+
--> $DIR/const-arg-in-const-arg.rs:40:24
165147
|
166148
LL | let _: Foo<{ baz::<'b>(&()) }>;
167149
| ^^
168150
|
169151
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
170152
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
171153

154+
error: generic parameters may not be used in const operations
155+
--> $DIR/const-arg-in-const-arg.rs:41:27
156+
|
157+
LL | let _ = Foo::<{ foo::<T>() }>;
158+
| ^ cannot perform const operation using `T`
159+
|
160+
= note: type parameters may not be used in const expressions
161+
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
162+
163+
error: generic parameters may not be used in const operations
164+
--> $DIR/const-arg-in-const-arg.rs:42:27
165+
|
166+
LL | let _ = Foo::<{ bar::<N>() }>;
167+
| ^ cannot perform const operation using `N`
168+
|
169+
= help: const parameters may only be used as standalone arguments, i.e. `N`
170+
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
171+
172172
error[E0658]: a non-static lifetime is not allowed in a `const`
173-
--> $DIR/const-arg-in-const-arg.rs:37:27
173+
--> $DIR/const-arg-in-const-arg.rs:44:27
174174
|
175175
LL | let _ = Foo::<{ faz::<'a>(&()) }>;
176176
| ^^
@@ -179,7 +179,7 @@ LL | let _ = Foo::<{ faz::<'a>(&()) }>;
179179
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
180180

181181
error[E0658]: a non-static lifetime is not allowed in a `const`
182-
--> $DIR/const-arg-in-const-arg.rs:38:27
182+
--> $DIR/const-arg-in-const-arg.rs:46:27
183183
|
184184
LL | let _ = Foo::<{ baz::<'a>(&()) }>;
185185
| ^^
@@ -188,7 +188,7 @@ LL | let _ = Foo::<{ baz::<'a>(&()) }>;
188188
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
189189

190190
error[E0658]: a non-static lifetime is not allowed in a `const`
191-
--> $DIR/const-arg-in-const-arg.rs:39:27
191+
--> $DIR/const-arg-in-const-arg.rs:47:27
192192
|
193193
LL | let _ = Foo::<{ faz::<'b>(&()) }>;
194194
| ^^
@@ -197,14 +197,163 @@ LL | let _ = Foo::<{ faz::<'b>(&()) }>;
197197
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
198198

199199
error[E0658]: a non-static lifetime is not allowed in a `const`
200-
--> $DIR/const-arg-in-const-arg.rs:40:27
200+
--> $DIR/const-arg-in-const-arg.rs:49:27
201201
|
202202
LL | let _ = Foo::<{ baz::<'b>(&()) }>;
203203
| ^^
204204
|
205205
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
206206
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
207207

208-
error: aborting due to 23 previous errors
208+
error[E0747]: unresolved item provided when a constant was expected
209+
--> $DIR/const-arg-in-const-arg.rs:14:23
210+
|
211+
LL | let _: [u8; bar::<N>()];
212+
| ^
213+
|
214+
help: if this generic argument was intended as a const parameter, surround it with braces
215+
|
216+
LL | let _: [u8; bar::<{ N }>()];
217+
| + +
218+
219+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
220+
--> $DIR/const-arg-in-const-arg.rs:16:23
221+
|
222+
LL | let _: [u8; faz::<'a>(&())];
223+
| ^^
224+
|
225+
note: the late bound lifetime parameter is introduced here
226+
--> $DIR/const-arg-in-const-arg.rs:8:14
227+
|
228+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
229+
| ^^
230+
231+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
232+
--> $DIR/const-arg-in-const-arg.rs:19:23
233+
|
234+
LL | let _: [u8; faz::<'b>(&())];
235+
| ^^
236+
|
237+
note: the late bound lifetime parameter is introduced here
238+
--> $DIR/const-arg-in-const-arg.rs:8:14
239+
|
240+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
241+
| ^^
242+
243+
error[E0747]: unresolved item provided when a constant was expected
244+
--> $DIR/const-arg-in-const-arg.rs:24:23
245+
|
246+
LL | let _ = [0; bar::<N>()];
247+
| ^
248+
|
249+
help: if this generic argument was intended as a const parameter, surround it with braces
250+
|
251+
LL | let _ = [0; bar::<{ N }>()];
252+
| + +
253+
254+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
255+
--> $DIR/const-arg-in-const-arg.rs:26:23
256+
|
257+
LL | let _ = [0; faz::<'a>(&())];
258+
| ^^
259+
|
260+
note: the late bound lifetime parameter is introduced here
261+
--> $DIR/const-arg-in-const-arg.rs:8:14
262+
|
263+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
264+
| ^^
265+
266+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
267+
--> $DIR/const-arg-in-const-arg.rs:29:23
268+
|
269+
LL | let _ = [0; faz::<'b>(&())];
270+
| ^^
271+
|
272+
note: the late bound lifetime parameter is introduced here
273+
--> $DIR/const-arg-in-const-arg.rs:8:14
274+
|
275+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
276+
| ^^
277+
278+
error[E0747]: unresolved item provided when a constant was expected
279+
--> $DIR/const-arg-in-const-arg.rs:33:24
280+
|
281+
LL | let _: Foo<{ bar::<N>() }>;
282+
| ^
283+
|
284+
help: if this generic argument was intended as a const parameter, surround it with braces
285+
|
286+
LL | let _: Foo<{ bar::<{ N }>() }>;
287+
| + +
288+
289+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
290+
--> $DIR/const-arg-in-const-arg.rs:35:24
291+
|
292+
LL | let _: Foo<{ faz::<'a>(&()) }>;
293+
| ^^
294+
|
295+
note: the late bound lifetime parameter is introduced here
296+
--> $DIR/const-arg-in-const-arg.rs:8:14
297+
|
298+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
299+
| ^^
300+
301+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
302+
--> $DIR/const-arg-in-const-arg.rs:38:24
303+
|
304+
LL | let _: Foo<{ faz::<'b>(&()) }>;
305+
| ^^
306+
|
307+
note: the late bound lifetime parameter is introduced here
308+
--> $DIR/const-arg-in-const-arg.rs:8:14
309+
|
310+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
311+
| ^^
312+
313+
error: constant expression depends on a generic parameter
314+
--> $DIR/const-arg-in-const-arg.rs:23:17
315+
|
316+
LL | let _ = [0; foo::<T>()];
317+
| ^^^^^^^^^^
318+
|
319+
= note: this may fail depending on what value the parameter takes
320+
321+
error[E0747]: unresolved item provided when a constant was expected
322+
--> $DIR/const-arg-in-const-arg.rs:42:27
323+
|
324+
LL | let _ = Foo::<{ bar::<N>() }>;
325+
| ^
326+
|
327+
help: if this generic argument was intended as a const parameter, surround it with braces
328+
|
329+
LL | let _ = Foo::<{ bar::<{ N }>() }>;
330+
| + +
331+
332+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
333+
--> $DIR/const-arg-in-const-arg.rs:44:27
334+
|
335+
LL | let _ = Foo::<{ faz::<'a>(&()) }>;
336+
| ^^
337+
|
338+
note: the late bound lifetime parameter is introduced here
339+
--> $DIR/const-arg-in-const-arg.rs:8:14
340+
|
341+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
342+
| ^^
343+
344+
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
345+
--> $DIR/const-arg-in-const-arg.rs:47:27
346+
|
347+
LL | let _ = Foo::<{ faz::<'b>(&()) }>;
348+
| ^^
349+
|
350+
note: the late bound lifetime parameter is introduced here
351+
--> $DIR/const-arg-in-const-arg.rs:8:14
352+
|
353+
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
354+
| ^^
355+
356+
error: aborting due to 36 previous errors
209357

210-
For more information about this error, try `rustc --explain E0658`.
358+
Some errors have detailed explanations: E0658, E0747.
359+
For more information about an error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)