]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.stderr
Make the `structural_match` error diagnostic for const generics clearer
[rust.git] / src / test / ui / const-generics / const-param-type-depends-on-type-param-ungated.stderr
1 error[E0658]: const generics are unstable
2   --> $DIR/const-param-type-depends-on-type-param-ungated.rs:3:19
3    |
4 LL | struct B<T, const N: T>(PhantomData<[T; N]>);
5    |                   ^
6    |
7    = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
8    = help: add `#![feature(const_generics)]` to the crate attributes to enable
9
10 error[E0741]: `T` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
11   --> $DIR/const-param-type-depends-on-type-param-ungated.rs:3:22
12    |
13 LL | struct B<T, const N: T>(PhantomData<[T; N]>);
14    |                      ^ `T` doesn't derive both `PartialEq` and `Eq`
15
16 error: aborting due to 2 previous errors
17
18 Some errors have detailed explanations: E0658, E0741.
19 For more information about an error, try `rustc --explain E0658`.