Closed
Description
The following code
struct G<T, const N: Vec<T>>(T);
fn main() {}
currently yields
error[E0770]: the type of const parameters must not depend on other generic parameters
--> src/lib.rs:1:26
|
1 | struct G<T, const N: Vec<T>>(T);
| ^ the type must not depend on the parameter `T`
|
= note: type parameters may not be used in the type of const parameters
error: `Vec<{type error}, {type error}>` is forbidden as the type of a const generic parameter
--> src/lib.rs:1:22
|
1 | struct G<T, const N: Vec<T>>(T);
| ^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
Ideally, we would replace the {type error}
with _
or prevent the second error from being be emitted (this can be achieved by bailing out early if the relevant type .references_errors()
).