fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
13.6 KiB359 linesraw
1error: generic parameters may not be used in const operations
2  --> $DIR/const-arg-in-const-arg.rs:15:23
3   |
4LL |     let _: [u8; foo::<T>()];
5   |                       ^ cannot perform const operation using `T`
6   |
7   = note: type parameters may not be used in const expressions
8   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
9
10error: generic parameters may not be used in const operations
11  --> $DIR/const-arg-in-const-arg.rs:16:23
12   |
13LL |     let _: [u8; bar::<N>()];
14   |                       ^ cannot perform const operation using `N`
15   |
16   = help: const parameters may only be used as standalone arguments, i.e. `N`
17   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
18
19error: generic parameters may not be used in const operations
20  --> $DIR/const-arg-in-const-arg.rs:18:23
21   |
22LL |     let _: [u8; faz::<'a>(&())];
23   |                       ^^ cannot perform const operation using `'a`
24   |
25   = note: lifetime parameters may not be used in const expressions
26   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
27
28error: generic parameters may not be used in const operations
29  --> $DIR/const-arg-in-const-arg.rs:20:23
30   |
31LL |     let _: [u8; baz::<'a>(&())];
32   |                       ^^ cannot perform const operation using `'a`
33   |
34   = note: lifetime parameters may not be used in const expressions
35   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
36
37error: generic parameters may not be used in const operations
38  --> $DIR/const-arg-in-const-arg.rs:21:23
39   |
40LL |     let _: [u8; faz::<'b>(&())];
41   |                       ^^ cannot perform const operation using `'b`
42   |
43   = note: lifetime parameters may not be used in const expressions
44   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
45
46error: generic parameters may not be used in const operations
47  --> $DIR/const-arg-in-const-arg.rs:23:23
48   |
49LL |     let _: [u8; baz::<'b>(&())];
50   |                       ^^ cannot perform const operation using `'b`
51   |
52   = note: lifetime parameters may not be used in const expressions
53   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
54
55error: generic parameters may not be used in const operations
56  --> $DIR/const-arg-in-const-arg.rs:26:23
57   |
58LL |     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
64error: generic parameters may not be used in const operations
65  --> $DIR/const-arg-in-const-arg.rs:28:23
66   |
67LL |     let _ = [0; faz::<'a>(&())];
68   |                       ^^ cannot perform const operation using `'a`
69   |
70   = note: lifetime parameters may not be used in const expressions
71   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
72
73error: generic parameters may not be used in const operations
74  --> $DIR/const-arg-in-const-arg.rs:30:23
75   |
76LL |     let _ = [0; baz::<'a>(&())];
77   |                       ^^ cannot perform const operation using `'a`
78   |
79   = note: lifetime parameters may not be used in const expressions
80   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
81
82error: generic parameters may not be used in const operations
83  --> $DIR/const-arg-in-const-arg.rs:31:23
84   |
85LL |     let _ = [0; faz::<'b>(&())];
86   |                       ^^ cannot perform const operation using `'b`
87   |
88   = note: lifetime parameters may not be used in const expressions
89   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
90
91error: generic parameters may not be used in const operations
92  --> $DIR/const-arg-in-const-arg.rs:33:23
93   |
94LL |     let _ = [0; baz::<'b>(&())];
95   |                       ^^ cannot perform const operation using `'b`
96   |
97   = note: lifetime parameters may not be used in const expressions
98   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
99
100error: generic parameters may not be used in const operations
101  --> $DIR/const-arg-in-const-arg.rs:34:24
102   |
103LL |     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
109error: generic parameters may not be used in const operations
110  --> $DIR/const-arg-in-const-arg.rs:35:24
111   |
112LL |     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
118error: generic parameters may not be used in const operations
119  --> $DIR/const-arg-in-const-arg.rs:37:24
120   |
121LL |     let _: Foo<{ faz::<'a>(&()) }>;
122   |                        ^^ cannot perform const operation using `'a`
123   |
124   = note: lifetime parameters may not be used in const expressions
125   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
126
127error: generic parameters may not be used in const operations
128  --> $DIR/const-arg-in-const-arg.rs:39:24
129   |
130LL |     let _: Foo<{ baz::<'a>(&()) }>;
131   |                        ^^ cannot perform const operation using `'a`
132   |
133   = note: lifetime parameters may not be used in const expressions
134   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
135
136error: generic parameters may not be used in const operations
137  --> $DIR/const-arg-in-const-arg.rs:40:24
138   |
139LL |     let _: Foo<{ faz::<'b>(&()) }>;
140   |                        ^^ cannot perform const operation using `'b`
141   |
142   = note: lifetime parameters may not be used in const expressions
143   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
144
145error: generic parameters may not be used in const operations
146  --> $DIR/const-arg-in-const-arg.rs:42:24
147   |
148LL |     let _: Foo<{ baz::<'b>(&()) }>;
149   |                        ^^ cannot perform const operation using `'b`
150   |
151   = note: lifetime parameters may not be used in const expressions
152   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
153
154error: generic parameters may not be used in const operations
155  --> $DIR/const-arg-in-const-arg.rs:43:27
156   |
157LL |     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
163error: generic parameters may not be used in const operations
164  --> $DIR/const-arg-in-const-arg.rs:44:27
165   |
166LL |     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
172error: generic parameters may not be used in const operations
173  --> $DIR/const-arg-in-const-arg.rs:46:27
174   |
175LL |     let _ = Foo::<{ faz::<'a>(&()) }>;
176   |                           ^^ cannot perform const operation using `'a`
177   |
178   = note: lifetime parameters may not be used in const expressions
179   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
180
181error: generic parameters may not be used in const operations
182  --> $DIR/const-arg-in-const-arg.rs:48:27
183   |
184LL |     let _ = Foo::<{ baz::<'a>(&()) }>;
185   |                           ^^ cannot perform const operation using `'a`
186   |
187   = note: lifetime parameters may not be used in const expressions
188   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
189
190error: generic parameters may not be used in const operations
191  --> $DIR/const-arg-in-const-arg.rs:49:27
192   |
193LL |     let _ = Foo::<{ faz::<'b>(&()) }>;
194   |                           ^^ cannot perform const operation using `'b`
195   |
196   = note: lifetime parameters may not be used in const expressions
197   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
198
199error: generic parameters may not be used in const operations
200  --> $DIR/const-arg-in-const-arg.rs:51:27
201   |
202LL |     let _ = Foo::<{ baz::<'b>(&()) }>;
203   |                           ^^ cannot perform const operation using `'b`
204   |
205   = note: lifetime parameters may not be used in const expressions
206   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
207
208error[E0747]: unresolved item provided when a constant was expected
209  --> $DIR/const-arg-in-const-arg.rs:16:23
210   |
211LL |     let _: [u8; bar::<N>()];
212   |                       ^
213   |
214help: if this generic argument was intended as a const parameter, surround it with braces
215   |
216LL |     let _: [u8; bar::<{ N }>()];
217   |                       +   +
218
219error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
220  --> $DIR/const-arg-in-const-arg.rs:18:23
221   |
222LL |     let _: [u8; faz::<'a>(&())];
223   |                       ^^
224   |
225note: the late bound lifetime parameter is introduced here
226  --> $DIR/const-arg-in-const-arg.rs:10:14
227   |
228LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
229   |              ^^
230
231error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
232  --> $DIR/const-arg-in-const-arg.rs:21:23
233   |
234LL |     let _: [u8; faz::<'b>(&())];
235   |                       ^^
236   |
237note: the late bound lifetime parameter is introduced here
238  --> $DIR/const-arg-in-const-arg.rs:10:14
239   |
240LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
241   |              ^^
242
243error[E0747]: unresolved item provided when a constant was expected
244  --> $DIR/const-arg-in-const-arg.rs:35:24
245   |
246LL |     let _: Foo<{ bar::<N>() }>;
247   |                        ^
248   |
249help: if this generic argument was intended as a const parameter, surround it with braces
250   |
251LL |     let _: Foo<{ bar::<{ N }>() }>;
252   |                        +   +
253
254error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
255  --> $DIR/const-arg-in-const-arg.rs:37:24
256   |
257LL |     let _: Foo<{ faz::<'a>(&()) }>;
258   |                        ^^
259   |
260note: the late bound lifetime parameter is introduced here
261  --> $DIR/const-arg-in-const-arg.rs:10:14
262   |
263LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
264   |              ^^
265
266error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
267  --> $DIR/const-arg-in-const-arg.rs:40:24
268   |
269LL |     let _: Foo<{ faz::<'b>(&()) }>;
270   |                        ^^
271   |
272note: the late bound lifetime parameter is introduced here
273  --> $DIR/const-arg-in-const-arg.rs:10:14
274   |
275LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
276   |              ^^
277
278error: constant expression depends on a generic parameter
279  --> $DIR/const-arg-in-const-arg.rs:25:17
280   |
281LL |     let _ = [0; foo::<T>()];
282   |                 ^^^^^^^^^^
283   |
284   = note: this may fail depending on what value the parameter takes
285
286error[E0747]: unresolved item provided when a constant was expected
287  --> $DIR/const-arg-in-const-arg.rs:26:23
288   |
289LL |     let _ = [0; bar::<N>()];
290   |                       ^
291   |
292help: if this generic argument was intended as a const parameter, surround it with braces
293   |
294LL |     let _ = [0; bar::<{ N }>()];
295   |                       +   +
296
297error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
298  --> $DIR/const-arg-in-const-arg.rs:28:23
299   |
300LL |     let _ = [0; faz::<'a>(&())];
301   |                       ^^
302   |
303note: the late bound lifetime parameter is introduced here
304  --> $DIR/const-arg-in-const-arg.rs:10:14
305   |
306LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
307   |              ^^
308
309error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
310  --> $DIR/const-arg-in-const-arg.rs:31:23
311   |
312LL |     let _ = [0; faz::<'b>(&())];
313   |                       ^^
314   |
315note: the late bound lifetime parameter is introduced here
316  --> $DIR/const-arg-in-const-arg.rs:10:14
317   |
318LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
319   |              ^^
320
321error[E0747]: unresolved item provided when a constant was expected
322  --> $DIR/const-arg-in-const-arg.rs:44:27
323   |
324LL |     let _ = Foo::<{ bar::<N>() }>;
325   |                           ^
326   |
327help: if this generic argument was intended as a const parameter, surround it with braces
328   |
329LL |     let _ = Foo::<{ bar::<{ N }>() }>;
330   |                           +   +
331
332error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
333  --> $DIR/const-arg-in-const-arg.rs:46:27
334   |
335LL |     let _ = Foo::<{ faz::<'a>(&()) }>;
336   |                           ^^
337   |
338note: the late bound lifetime parameter is introduced here
339  --> $DIR/const-arg-in-const-arg.rs:10:14
340   |
341LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
342   |              ^^
343
344error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
345  --> $DIR/const-arg-in-const-arg.rs:49:27
346   |
347LL |     let _ = Foo::<{ faz::<'b>(&()) }>;
348   |                           ^^
349   |
350note: the late bound lifetime parameter is introduced here
351  --> $DIR/const-arg-in-const-arg.rs:10:14
352   |
353LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
354   |              ^^
355
356error: aborting due to 36 previous errors
357
358Some errors have detailed explanations: E0747, E0794.
359For more information about an error, try `rustc --explain E0747`.