Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local crypto-common breaks digest #1359

Closed

Conversation

waynr
Copy link

@waynr waynr commented Oct 11, 2023

When I tried merging master branch into #1078 I had to update the digest
crate's dependency to point to the local crypto-common path as in this PR and
ended up with the following build errors:

   Compiling digest v0.11.0-pre (/home/wayne/projects/RustCrypto/traits/digest)
error[E0277]: the trait bound `<Self as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not satisfied
  --> digest/src/core_api.rs:43:52
   |
43 |     fn finalize_fixed_core(&mut self, buffer: &mut Buffer<Self>, out: &mut Output<Self>);
   |                                                    ^^^^^^^^^^^^ the trait `Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not implemented for `<Self as BlockSizeUser>::BlockSize`
   |
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider further restricting the associated type
   |
43 |     fn finalize_fixed_core(&mut self, buffer: &mut Buffer<Self>, out: &mut Output<Self>) where <Self as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>;
   |                                                                                          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<Self as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>` is not satisfied
  --> digest/src/core_api.rs:43:52
   |
43 |     fn finalize_fixed_core(&mut self, buffer: &mut Buffer<Self>, out: &mut Output<Self>);
   |                                                    ^^^^^^^^^^^^ the trait `Cmp<UInt<UTerm, B1>>` is not implemented for `<Self as BlockSizeUser>::BlockSize`
   |
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `IsGreater<UInt<UTerm, B1>>`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider further restricting the associated type
   |
43 |     fn finalize_fixed_core(&mut self, buffer: &mut Buffer<Self>, out: &mut Output<Self>) where <Self as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>;
   |                                                                                          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<Self as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not satisfied
  --> digest/src/core_api.rs:53:50
   |
53 |     fn finalize_xof_core(&mut self, buffer: &mut Buffer<Self>) -> Self::ReaderCore;
   |                                                  ^^^^^^^^^^^^ the trait `Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not implemented for `<Self as BlockSizeUser>::BlockSize`
   |
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider further restricting the associated type
   |
53 |     fn finalize_xof_core(&mut self, buffer: &mut Buffer<Self>) -> Self::ReaderCore where <Self as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>;
   |                                                                                    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<Self as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>` is not satisfied
  --> digest/src/core_api.rs:53:50
   |
53 |     fn finalize_xof_core(&mut self, buffer: &mut Buffer<Self>) -> Self::ReaderCore;
   |                                                  ^^^^^^^^^^^^ the trait `Cmp<UInt<UTerm, B1>>` is not implemented for `<Self as BlockSizeUser>::BlockSize`
   |
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `IsGreater<UInt<UTerm, B1>>`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider further restricting the associated type
   |
53 |     fn finalize_xof_core(&mut self, buffer: &mut Buffer<Self>) -> Self::ReaderCore where <Self as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>;
   |                                                                                    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<Self as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not satisfied
  --> digest/src/core_api.rs:93:55
   |
93 |     fn finalize_variable_core(&mut self, buffer: &mut Buffer<Self>, out: &mut Output<Self>);
   |                                                       ^^^^^^^^^^^^ the trait `Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not implemented for `<Self as BlockSizeUser>::BlockSize`
   |
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider further restricting the associated type
   |
93 |     fn finalize_variable_core(&mut self, buffer: &mut Buffer<Self>, out: &mut Output<Self>) where <Self as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>;
   |                                                                                             ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<Self as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>` is not satisfied
  --> digest/src/core_api.rs:93:55
   |
93 |     fn finalize_variable_core(&mut self, buffer: &mut Buffer<Self>, out: &mut Output<Self>);
   |                                                       ^^^^^^^^^^^^ the trait `Cmp<UInt<UTerm, B1>>` is not implemented for `<Self as BlockSizeUser>::BlockSize`
   |
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `IsGreater<UInt<UTerm, B1>>`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<Self as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider further restricting the associated type
   |
93 |     fn finalize_variable_core(&mut self, buffer: &mut Buffer<Self>, out: &mut Output<Self>) where <Self as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>;
   |                                                                                             ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not satisfied
   --> digest/src/core_api/ct_variable.rs:100:22
    |
100 |         buffer: &mut Buffer<Self>,
    |                      ^^^^^^^^^^^^ the trait `Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
    |
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
   --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
    |
61  | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
    |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider further restricting the associated type
    |
102 |     ) where <T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>> {
    |       +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>` is not satisfied
   --> digest/src/core_api/ct_variable.rs:100:22
    |
100 |         buffer: &mut Buffer<Self>,
    |                      ^^^^^^^^^^^^ the trait `Cmp<UInt<UTerm, B1>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
    |
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsGreater<UInt<UTerm, B1>>`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
   --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
    |
61  | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
    |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider further restricting the associated type
    |
102 |     ) where <T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>> {
    |       +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not satisfied
  --> digest/src/core_api/rt_variable.rs:18:13
   |
18 |     buffer: BlockBuffer<T::BlockSize, T::BufferKind>,
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
   |
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
   |
15 |     T: VariableOutputCore, <T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>
   |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>` is not satisfied
  --> digest/src/core_api/rt_variable.rs:18:13
   |
18 |     buffer: BlockBuffer<T::BlockSize, T::BufferKind>,
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Cmp<UInt<UTerm, B1>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
   |
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsGreater<UInt<UTerm, B1>>`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
   |
15 |     T: VariableOutputCore, <T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>
   |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not satisfied
  --> digest/src/core_api/wrapper.rs:26:13
   |
26 |     buffer: BlockBuffer<T::BlockSize, T::BufferKind>,
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
   |
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
   |
23 |     T: BufferKindUser, <T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>
   |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>` is not satisfied
  --> digest/src/core_api/wrapper.rs:26:13
   |
26 |     buffer: BlockBuffer<T::BlockSize, T::BufferKind>,
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Cmp<UInt<UTerm, B1>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
   |
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsGreater<UInt<UTerm, B1>>`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
   |
23 |     T: BufferKindUser, <T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>
   |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not satisfied
  --> digest/src/core_api/wrapper.rs:56:35
   |
56 |     pub fn decompose(self) -> (T, Buffer<T>) {
   |                                   ^^^^^^^^^ the trait `Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
   |
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider further restricting the associated type
   |
56 |     pub fn decompose(self) -> (T, Buffer<T>) where <T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>> {
   |                                              +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>` is not satisfied
  --> digest/src/core_api/wrapper.rs:56:35
   |
56 |     pub fn decompose(self) -> (T, Buffer<T>) {
   |                                   ^^^^^^^^^ the trait `Cmp<UInt<UTerm, B1>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
   |
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsGreater<UInt<UTerm, B1>>`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `BlockBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/lib.rs:61:28
   |
61 | pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> {
   |                            ^^^^^^^^^^ required by this bound in `BlockBuffer`
help: consider further restricting the associated type
   |
56 |     pub fn decompose(self) -> (T, Buffer<T>) where <T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>> {
   |                                              +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not satisfied
  --> digest/src/core_api/xof_reader.rs:15:24
   |
15 |     pub(super) buffer: ReadBuffer<T::BlockSize>,
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
   |
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `ReadBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/read.rs:6:27
   |
6  | pub struct ReadBuffer<BS: BlockSizes> {
   |                           ^^^^^^^^^^ required by this bound in `ReadBuffer`
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
   |
12 |     T: XofReaderCore, <T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>
   |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>` is not satisfied
  --> digest/src/core_api/xof_reader.rs:15:24
   |
15 |     pub(super) buffer: ReadBuffer<T::BlockSize>,
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Cmp<UInt<UTerm, B1>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
   |
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsGreater<UInt<UTerm, B1>>`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
   = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
note: required by a bound in `ReadBuffer`
  --> /home/wayne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/block-buffer-0.11.0-pre/src/read.rs:6:27
   |
6  | pub struct ReadBuffer<BS: BlockSizes> {
   |                           ^^^^^^^^^^ required by this bound in `ReadBuffer`
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
   |
12 |     T: XofReaderCore, <T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>
   |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not satisfied
   --> digest/src/core_api/xof_reader.rs:9:10
    |
9   | #[derive(Clone, Default)]
    |          ^^^^^ the trait `Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
    |
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
    = note: required for `ReadBuffer<<T as BlockSizeUser>::BlockSize>` to implement `crypto_common::BlockSizeUser`
note: required because it appears within the type `XofReaderCoreWrapper<T>`
   --> digest/src/core_api/xof_reader.rs:10:12
    |
10  | pub struct XofReaderCoreWrapper<T>
    |            ^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `Clone`
   --> /home/wayne/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/clone.rs:107:18
    |
107 | pub trait Clone: Sized {
    |                  ^^^^^ required by this bound in `Clone`
    = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting the associated type
    |
9   | #[derive(Clone, <T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>, Default)]
    |               +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>` is not satisfied
   --> digest/src/core_api/xof_reader.rs:9:10
    |
9   | #[derive(Clone, Default)]
    |          ^^^^^ the trait `Cmp<UInt<UTerm, B1>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
    |
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsGreater<UInt<UTerm, B1>>`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
    = note: required for `ReadBuffer<<T as BlockSizeUser>::BlockSize>` to implement `crypto_common::BlockSizeUser`
note: required because it appears within the type `XofReaderCoreWrapper<T>`
   --> digest/src/core_api/xof_reader.rs:10:12
    |
10  | pub struct XofReaderCoreWrapper<T>
    |            ^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `Clone`
   --> /home/wayne/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/clone.rs:107:18
    |
107 | pub trait Clone: Sized {
    |                  ^^^^^ required by this bound in `Clone`
    = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting the associated type
    |
9   | #[derive(Clone, <T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>, Default)]
    |               +++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not satisfied
   --> digest/src/core_api/xof_reader.rs:9:17
    |
9   | #[derive(Clone, Default)]
    |                 ^^^^^^^ the trait `Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
    |
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
    = note: required for `ReadBuffer<<T as BlockSizeUser>::BlockSize>` to implement `crypto_common::BlockSizeUser`
note: required because it appears within the type `XofReaderCoreWrapper<T>`
   --> digest/src/core_api/xof_reader.rs:10:12
    |
10  | pub struct XofReaderCoreWrapper<T>
    |            ^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `Default`
   --> /home/wayne/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/default.rs:102:20
    |
102 | pub trait Default: Sized {
    |                    ^^^^^ required by this bound in `Default`
    = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting the associated type
    |
9   | #[derive(Clone, Default, <T as BlockSizeUser>::BlockSize: Cmp<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>)]
    |                        +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `<T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>` is not satisfied
   --> digest/src/core_api/xof_reader.rs:9:17
    |
9   | #[derive(Clone, Default)]
    |                 ^^^^^^^ the trait `Cmp<UInt<UTerm, B1>>` is not implemented for `<T as BlockSizeUser>::BlockSize`
    |
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `IsGreater<UInt<UTerm, B1>>`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::sealed::BlockSizes`
    = note: required for `<T as BlockSizeUser>::BlockSize` to implement `crypto_common::BlockSizes`
    = note: required for `ReadBuffer<<T as BlockSizeUser>::BlockSize>` to implement `crypto_common::BlockSizeUser`
note: required because it appears within the type `XofReaderCoreWrapper<T>`
   --> digest/src/core_api/xof_reader.rs:10:12
    |
10  | pub struct XofReaderCoreWrapper<T>
    |            ^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `Default`
   --> /home/wayne/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/default.rs:102:20
    |
102 | pub trait Default: Sized {
    |                    ^^^^^ required by this bound in `Default`
    = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting the associated type
    |
9   | #[derive(Clone, Default, <T as BlockSizeUser>::BlockSize: Cmp<UInt<UTerm, B1>>)]
    |                        +++++++++++++++++++++++++++++++++++++++++++++++++++++++

For more information about this error, try `rustc --explain E0277`.
error: could not compile `digest` (lib) due to 20 previous errors

I'm mostly opening this PR just to demonstrate the problem, I'm not sure how to
fix this (but happy to take any guidance). I suspect the maintainers may
already know about this and have WIP to address it.

@waynr waynr marked this pull request as draft October 11, 2023 16:33
@tarcieri
Copy link
Member

It works in #1358

@waynr
Copy link
Author

waynr commented Oct 11, 2023

@tarcieri it looks like there are a lot of instances of ArrayLength<u8> trait bounds replaced with BlockSizes in that PR, could that be what fixes it? Would we have to wait for that PR before moving forward with #1078 then?

@tarcieri
Copy link
Member

It would probably make sense, yes

@waynr
Copy link
Author

waynr commented Oct 11, 2023

Cool, thanks for your quick responses. I'll make a note of the dependency on #1358 in #1078, close this PR, and keep an eye on those two. Unfortunately I don't think I can be very helpful in moving anything forward given how complex the types are here :( (not to mention my ignorance of cryptography).

@waynr waynr closed this Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants