@@ -16,53 +16,8 @@ LL | let _: [u8; bar::<N>()];
16
16
= help: const parameters may only be used as standalone arguments, i.e. `N`
17
17
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
18
18
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
-
64
19
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
66
21
|
67
22
LL | let _: [u8; faz::<'a>(&())];
68
23
| ^^
@@ -71,7 +26,7 @@ LL | let _: [u8; faz::<'a>(&())];
71
26
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
72
27
73
28
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
75
30
|
76
31
LL | let _: [u8; baz::<'a>(&())];
77
32
| ^^
@@ -80,7 +35,7 @@ LL | let _: [u8; baz::<'a>(&())];
80
35
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
81
36
82
37
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
84
39
|
85
40
LL | let _: [u8; faz::<'b>(&())];
86
41
| ^^
@@ -89,16 +44,25 @@ LL | let _: [u8; faz::<'b>(&())];
89
44
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
90
45
91
46
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
93
48
|
94
49
LL | let _: [u8; baz::<'b>(&())];
95
50
| ^^
96
51
|
97
52
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
98
53
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
99
54
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
+
100
64
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
102
66
|
103
67
LL | let _ = [0; faz::<'a>(&())];
104
68
| ^^
@@ -107,7 +71,7 @@ LL | let _ = [0; faz::<'a>(&())];
107
71
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
108
72
109
73
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
111
75
|
112
76
LL | let _ = [0; baz::<'a>(&())];
113
77
| ^^
@@ -116,7 +80,7 @@ LL | let _ = [0; baz::<'a>(&())];
116
80
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
117
81
118
82
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
120
84
|
121
85
LL | let _ = [0; faz::<'b>(&())];
122
86
| ^^
@@ -125,16 +89,34 @@ LL | let _ = [0; faz::<'b>(&())];
125
89
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
126
90
127
91
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
129
93
|
130
94
LL | let _ = [0; baz::<'b>(&())];
131
95
| ^^
132
96
|
133
97
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
134
98
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
135
99
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
+
136
118
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
138
120
|
139
121
LL | let _: Foo<{ faz::<'a>(&()) }>;
140
122
| ^^
@@ -143,7 +125,7 @@ LL | let _: Foo<{ faz::<'a>(&()) }>;
143
125
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
144
126
145
127
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
147
129
|
148
130
LL | let _: Foo<{ baz::<'a>(&()) }>;
149
131
| ^^
@@ -152,7 +134,7 @@ LL | let _: Foo<{ baz::<'a>(&()) }>;
152
134
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
153
135
154
136
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
156
138
|
157
139
LL | let _: Foo<{ faz::<'b>(&()) }>;
158
140
| ^^
@@ -161,16 +143,34 @@ LL | let _: Foo<{ faz::<'b>(&()) }>;
161
143
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
162
144
163
145
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
165
147
|
166
148
LL | let _: Foo<{ baz::<'b>(&()) }>;
167
149
| ^^
168
150
|
169
151
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
170
152
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
171
153
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
+
172
172
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
174
174
|
175
175
LL | let _ = Foo::<{ faz::<'a>(&()) }>;
176
176
| ^^
@@ -179,7 +179,7 @@ LL | let _ = Foo::<{ faz::<'a>(&()) }>;
179
179
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
180
180
181
181
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
183
183
|
184
184
LL | let _ = Foo::<{ baz::<'a>(&()) }>;
185
185
| ^^
@@ -188,7 +188,7 @@ LL | let _ = Foo::<{ baz::<'a>(&()) }>;
188
188
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
189
189
190
190
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
192
192
|
193
193
LL | let _ = Foo::<{ faz::<'b>(&()) }>;
194
194
| ^^
@@ -197,14 +197,163 @@ LL | let _ = Foo::<{ faz::<'b>(&()) }>;
197
197
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
198
198
199
199
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
201
201
|
202
202
LL | let _ = Foo::<{ baz::<'b>(&()) }>;
203
203
| ^^
204
204
|
205
205
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
206
206
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
207
207
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
209
357
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