elliptic-curves
elliptic-curves copied to clipboard
Add core::fmt::Debug constraint to PrimeCurveParams::FieldElement
Building with master causes the below error depending on usage.
error[E0277]: `<C as PrimeCurveParams>::FieldElement` doesn't implement `Debug`
--> /home/coder0xff/Dropbox/Documents/Projects/Community/src/community/elliptic-curves/primeorder/src/affine.rs:290:30
|
290 | impl<C> PrimeCurveAffine for AffinePoint<C>
| ^^^^^^^^^^^^^^ `<C as PrimeCurveParams>::FieldElement` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
= help: the trait `Debug` is not implemented for `<C as PrimeCurveParams>::FieldElement`
note: required for `AffinePoint<C>` to implement `Debug`
--> /home/coder0xff/Dropbox/Documents/Projects/Community/src/community/elliptic-curves/primeorder/src/affine.rs:28:23
|
28 | #[derive(Clone, Copy, Debug)]
| ^^^^^ unsatisfied trait bound introduced in this `derive` macro
note: required by a bound in `PrimeCurveAffine`
--> /home/coder0xff/.cargo/registry/src/index.crates.io-6f17d22bba15001f/group-0.13.0/src/prime.rs:27:7
|
21 | pub trait PrimeCurveAffine: GroupEncoding
| ---------------- required by a bound in this trait
...
27 | + fmt::Debug
| ^^^^^^^^^^ required by this bound in `PrimeCurveAffine`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting the associated type
|
298 | <UncompressedPointSize<C> as ArraySize>::ArrayType<u8>: Copy, <C as PrimeCurveParams>::FieldElement: Debug
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I'm confused what's the error you're reporting here. Everything builds for me locally and in CI.
The toolchain for the embedded platform I'm working on is based on nightly Rust, so it could be caused by that. The constraint I added isn't wrong at least, as Debug isn't included in PrimeField or Invert.
I can also build all of the crates in this repo locally with 1.78.0-nightly (7065f0ef4 2024-03-12).
It's unclear to me what's requiring a Debug impl in this case.
We can potentially add one, but it would be helpful to fully understand the situation first.