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

Crate doesn't compile without default features #191

Closed
survived opened this issue Oct 7, 2024 · 1 comment · Fixed by #192
Closed

Crate doesn't compile without default features #191

survived opened this issue Oct 7, 2024 · 1 comment · Fixed by #192

Comments

@survived
Copy link

survived commented Oct 7, 2024

Steps to reproduce:

Either add the crate into dependencies as:

"vodozemac" = { version = "0.8", default-features = false }

then cargo check returns this compile error:

Error

    Checking vodozemac v0.8.0
error[E0599]: no function or associated item named `new_pickle` found for struct `Cipher` in the current scope
   --> /home/denis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vodozemac-0.8.0/src/utilities/mod.rs:50:41
    |
50  |     let cipher = crate::cipher::Cipher::new_pickle(pickle_key);
    |                                         ^^^^^^^^^^ function or associated item not found in `Cipher`
    |
   ::: /home/denis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vodozemac-0.8.0/src/cipher/mod.rs:97:1
    |
97  | pub struct Cipher {
    | ----------------- function or associated item `new_pickle` not found for this struct
    |
note: if you're trying to build a new `Cipher` consider using one of the following associated functions:
      Cipher::new
      Cipher::new_megolm
   --> /home/denis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vodozemac-0.8.0/src/cipher/mod.rs:110:5
    |
110 |     pub fn new(key: &[u8; 32]) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
125 |     pub fn new_megolm(&key: &[u8; 128]) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0599]: no function or associated item named `new_pickle` found for struct `Cipher` in the current scope
   --> /home/denis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vodozemac-0.8.0/src/utilities/mod.rs:65:41
    |
65  |     let cipher = crate::cipher::Cipher::new_pickle(pickle_key);
    |                                         ^^^^^^^^^^ function or associated item not found in `Cipher`
    |
   ::: /home/denis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vodozemac-0.8.0/src/cipher/mod.rs:97:1
    |
97  | pub struct Cipher {
    | ----------------- function or associated item `new_pickle` not found for this struct
    |
note: if you're trying to build a new `Cipher` consider using one of the following associated functions:
      Cipher::new
      Cipher::new_megolm
   --> /home/denis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vodozemac-0.8.0/src/cipher/mod.rs:110:5
    |
110 |     pub fn new(key: &[u8; 32]) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
125 |     pub fn new_megolm(&key: &[u8; 128]) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

or, just checkout 0.8.0 tag:

git checkout 0.8.0
cargo check -p vodozemac --no-default-features

which will produce the same error message:

Error

$ cargo check -p vodozemac --no-default-features
    Checking vodozemac v0.8.0 (/home/denis/Projects/vodozemac)
error[E0599]: no function or associated item named `new_pickle` found for struct `Cipher` in the current scope
   --> src/utilities/mod.rs:50:41
    |
50  |     let cipher = crate::cipher::Cipher::new_pickle(pickle_key);
    |                                         ^^^^^^^^^^ function or associated item not found in `Cipher`
    |
   ::: src/cipher/mod.rs:97:1
    |
97  | pub struct Cipher {
    | ----------------- function or associated item `new_pickle` not found for this struct
    |
note: if you're trying to build a new `Cipher` consider using one of the following associated functions:
      Cipher::new
      Cipher::new_megolm
   --> src/cipher/mod.rs:110:5
    |
110 |     pub fn new(key: &[u8; 32]) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
125 |     pub fn new_megolm(&key: &[u8; 128]) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0599]: no function or associated item named `new_pickle` found for struct `Cipher` in the current scope
   --> src/utilities/mod.rs:65:41
    |
65  |     let cipher = crate::cipher::Cipher::new_pickle(pickle_key);
    |                                         ^^^^^^^^^^ function or associated item not found in `Cipher`
    |
   ::: src/cipher/mod.rs:97:1
    |
97  | pub struct Cipher {
    | ----------------- function or associated item `new_pickle` not found for this struct
    |
note: if you're trying to build a new `Cipher` consider using one of the following associated functions:
      Cipher::new
      Cipher::new_megolm
   --> src/cipher/mod.rs:110:5
    |
110 |     pub fn new(key: &[u8; 32]) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
125 |     pub fn new_megolm(&key: &[u8; 128]) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `zeroize::Zeroize`
  --> src/utilities/mod.rs:48:9
   |
48 |     use zeroize::Zeroize;
   |         ^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

For more information about this error, try `rustc --explain E0599`.
warning: `vodozemac` (lib) generated 1 warning
error: could not compile `vodozemac` (lib) due to 2 previous errors; 1 warning emitted

@poljar
Copy link
Collaborator

poljar commented Oct 7, 2024

Whops, why wasn't this part of the CI. Oh well, should be fixed by #192.

Thanks for the report.

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 a pull request may close this issue.

2 participants