The following code
#![feature(const_generics)]
#![feature(structural_match)]
struct Inner;
#[derive(PartialEq, Eq)]
struct Outer {
inner: Inner
}
struct S<const O: Outer>;
const C : S<{ Outer { inner: Inner } }> = S;
results in the error
error[E0741]: `Outer` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
--> src/lib.rs:11:19
|
| struct S<const O: Outer>;
| ^^^^^ `Outer` doesn't derive both `PartialEq` and `Eq`
Which is not correct: Outer does derive PartialEq and Eq.
The true error is that Inner does not derive the traits (or implements StructuralEq and StructuralPartialEq), however it is probably not a good idea to leak this type in the error message, as it is an implementation detail?
The following code
results in the error
Which is not correct:
Outerdoes derivePartialEqandEq.The true error is that
Innerdoes not derive the traits (or implementsStructuralEqandStructuralPartialEq), however it is probably not a good idea to leak this type in the error message, as it is an implementation detail?