rust-bitcoin/rust-bitcoinconsensus

Failure to build dependent crates due to missing trait derivations

Closed this issue · 3 comments

tnull commented

In 2bbfc28 all trait derivations except for Debug was removed. Now that this change shipped we're seeing some breakage downstream, i.e., rust-bitcoin 0.30.2 as we use it in rust-lightning fails with:

error[E0204]: the trait `std::marker::Copy` cannot be implemented for this type
   --> /Users/ero/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.30.2/src/blockdata/script/mod.rs:730:62
    |
730 | #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
    |                                                              ^^^^
...
743 |     BitcoinConsensus(bitcoinconsensus::Error),
    |                      ----------------------- this field does not implement `std::marker::Copy`
    |
    = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0204`.
error: could not compile `bitcoin` (lib) due to previous error

And locally I'm seeing the following for current master of rust-bitcoin:

error[E0277]: the trait bound `bitcoinconsensus::Error: Clone` is not satisfied
   --> bitcoin/src/consensus/validation.rs:183:34
    |
181 | #[derive(Debug, Clone, PartialEq, Eq)]
    |                 ----- in this derive macro expansion
182 | #[non_exhaustive]
183 | pub struct BitcoinconsensusError(bitcoinconsensus::Error);
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `bitcoinconsensus::Error`
    |
    = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `bitcoinconsensus::Error`
   --> bitcoin/src/consensus/validation.rs:183:34
    |
181 | #[derive(Debug, Clone, PartialEq, Eq)]
    |                        --------- in this derive macro expansion
182 | #[non_exhaustive]
183 | pub struct BitcoinconsensusError(bitcoinconsensus::Error);
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `bitcoinconsensus::Error: std::cmp::Eq` is not satisfied
   --> bitcoin/src/consensus/validation.rs:183:34
    |
181 | #[derive(Debug, Clone, PartialEq, Eq)]
    |                                   -- in this derive macro expansion
182 | #[non_exhaustive]
183 | pub struct BitcoinconsensusError(bitcoinconsensus::Error);
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `bitcoinconsensus::Error`
    |
note: required by a bound in `AssertParamIsEq`
   --> /Users/ero/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/cmp.rs:313:31
    |
313 | pub struct AssertParamIsEq<T: Eq + ?Sized> {
    |                               ^^ required by this bound in `AssertParamIsEq`
    = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0277, E0369.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `bitcoin` (lib) due to 3 previous errors
tnull commented

Oh, I see this was already caught and is being worked on in #72.

tnull commented

Closing as bitcoinconsensus 0.20.2-0.6.0 just has been yanked.

Thanks @tnull, sorry for the problem, that was all me.