Closed
Description
I tried this code:
#![allow(incomplete_features)]
#![feature(const_generics)]
pub trait GT<T: Eq + PartialEq, const N: T> {}
This produces the following error on rustc 1.44.0-nightly:
error[E0741]: the types of const generic parameters must derive `PartialEq` and `Eq`
--> src/lib.rs:4:42
|
4 | pub trait GT<T: Eq + PartialEq, const N: T> {}
| ^ `T` doesn't derive both `PartialEq` and `Eq`
error: aborting due to previous error
I guess that const generics with a generic type isn't supported/allowed. If that's the case, this should be mentioned in the error message.
Meta
rustc --version --verbose
:
rustc 1.44.0-nightly (74bd074ee 2020-04-03)
binary: rustc
commit-hash: 74bd074eefcf4915c73d1ab91bc90859664729e6
commit-date: 2020-04-03
host: x86_64-unknown-linux-gnu
release: 1.44.0-nightly
LLVM version: 9.0