Skip to content

Compilation error in current rust version #9

@BoostCookie

Description

@BoostCookie

Just doing git clone "https://github.com/tmthecoder/xotp.git"; cd xotp; cargo test gives me errors:

% cargo test
   Compiling xotp v0.4.0 (/home/geher/SonstigesSSD/Projects/xotp)
error[E0277]: the trait bound `D: InnerInit` is not satisfied
  --> src/util.rs:66:20
   |
66 |     let mut hmac = <D>::new_from_slice(secret).expect("Failed to initialize HMAC");
   |                    ^^^^^^^^^^^^^^^^^^^ the trait `InnerInit` is not implemented for `D`
   |
   = note: required because of the requirements on the impl of `KeyInit` for `D`
note: required by a bound in `hmac::Mac::new_from_slice`
  --> /home/geher/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/digest-0.10.5/src/mac.rs:35:15
   |
35 |         Self: KeyInit;
   |               ^^^^^^^ required by this bound in `hmac::Mac::new_from_slice`
help: consider further restricting this bound
   |
65 | fn hash_internal<D: Mac + hmac::digest::InnerInit>(msg: &[u8], secret: &[u8]) -> Vec<u8> {
   |                         +++++++++++++++++++++++++

For more information about this error, try `rustc --explain E0277`.
error: could not compile `xotp` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed

I'm using

% cargo version
cargo 1.60.0-nightly (95bb3c92b 2022-01-18)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions