Fix trait bounds on SigType.
When Rust derives Copy, Clone, Eq, PartialEq, etc. on a type with `PhantomData<T>`, it adds a `T: Clone` etc. bound, regardless of whether `T` is only ever used inside of the `PhantomData`. A better fix would be to fix the derived bounds themselves, but in the meantime this works, even if it's slightly ugly.
This commit is contained in:
parent
76eb4c5928
commit
798a3e4631
|
@ -40,18 +40,18 @@ pub use signature::Signature;
|
|||
pub trait SigType: private::Sealed {}
|
||||
|
||||
/// A type variable corresponding to Zcash's `BindingSig`.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
pub enum Binding {}
|
||||
impl SigType for Binding {}
|
||||
|
||||
/// A type variable corresponding to Zcash's `SpendAuthSig`.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
pub enum SpendAuth {}
|
||||
impl SigType for SpendAuth {}
|
||||
|
||||
pub(crate) mod private {
|
||||
use super::*;
|
||||
pub trait Sealed: Copy + Clone + std::fmt::Debug {
|
||||
pub trait Sealed: Copy + Clone + Eq + PartialEq + std::fmt::Debug {
|
||||
fn basepoint() -> jubjub::ExtendedPoint;
|
||||
}
|
||||
impl Sealed for Binding {
|
||||
|
|
Loading…
Reference in New Issue