]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const-param-type-depends-on-type-param.rs
4dcda3b87a8545424c1b2058728850ca8ebd279e
[rust.git] / src / test / ui / const-generics / const-param-type-depends-on-type-param.rs
1 #![feature(const_generics)]
2 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
3
4 // Currently, const parameters cannot depend on type parameters, because there is no way to
5 // enforce the structural-match property on an arbitrary type parameter. This restriction
6 // may be relaxed in the future. See https://github.com/rust-lang/rfcs/pull/2000 for more
7 // details.
8
9 pub struct Dependent<T, const X: T>([(); X]);
10 //~^ ERROR `T` must be annotated with `#[derive(PartialEq, Eq)]`
11
12 fn main() {}