Skip to content

cargo check --no-default-features fails #160

@ch3pjw

Description

@ch3pjw

Running cargo check --no-default-features fails on the latest tag (v0.34.1) and on master (467b6c0, 7 commits after the v0.34.1 tag).

My use case for --no-default-features is that I want to use just the mysql_common data types in a library to expose to other crates. Looking at Cargo.toml I don't think I can use --no-default-features and then enable flate2 manually to make this go away.

It looks like an issue with the flate dependency:

cargo check --no-default-features
  Downloaded thiserror v1.0.64
  Downloaded thiserror-impl v1.0.64
  Downloaded 2 crates (37.6 KB) in 0.13s
   Compiling thiserror v1.0.64
    Checking lazy_static v1.5.0
   Compiling jobserver v0.1.32
    Checking typenum v1.17.0
   Compiling num-traits v0.2.19
    Checking getrandom v0.2.15
   Compiling subprocess v0.2.9
    Checking regex-automata v0.4.8
    Checking flate2 v1.0.34
   Compiling quote v1.0.37
error: You need to choose a zlib backend
   --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/lib.rs:100:1
    |
100 | compile_error!("You need to choose a zlib backend");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0432]: unresolved imports `crate::ffi::Deflate`, `crate::ffi::ErrorMessage`, `crate::ffi::Inflate`
 --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/mem.rs:5:33
  |
5 | use crate::ffi::{self, Backend, Deflate, DeflateBackend, ErrorMessage, Inflate, InflateBackend};
  |                                 ^^^^^^^                  ^^^^^^^^^^^^  ^^^^^^^ no `Inflate` in `ffi`
  |                                 |                        |
  |                                 |                        no `ErrorMessage` in `ffi`
  |                                 no `Deflate` in `ffi`

    Checking rand_core v0.6.4
error[E0412]: cannot find type `ErrorMessage` in this scope
  --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/ffi/mod.rs:48:26
   |
48 | impl std::fmt::Debug for ErrorMessage {
   |                          ^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `MZ_NO_FLUSH` in module `ffi`
  --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/mem.rs:50:17
   |
50 |     None = ffi::MZ_NO_FLUSH as isize,
   |                 ^^^^^^^^^^^ not found in `ffi`

error[E0425]: cannot find value `MZ_SYNC_FLUSH` in module `ffi`
  --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/mem.rs:59:17
   |
59 |     Sync = ffi::MZ_SYNC_FLUSH as isize,
   |                 ^^^^^^^^^^^^^ not found in `ffi`

error[E0425]: cannot find value `MZ_PARTIAL_FLUSH` in module `ffi`
  --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/mem.rs:69:20
   |
69 |     Partial = ffi::MZ_PARTIAL_FLUSH as isize,
   |                    ^^^^^^^^^^^^^^^^ not found in `ffi`

error[E0425]: cannot find value `MZ_FULL_FLUSH` in module `ffi`
  --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/mem.rs:76:17
   |
76 |     Full = ffi::MZ_FULL_FLUSH as isize,
   |                 ^^^^^^^^^^^^^ not found in `ffi`

error[E0425]: cannot find value `MZ_FINISH` in module `ffi`
  --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/mem.rs:82:19
   |
82 |     Finish = ffi::MZ_FINISH as isize,
   |                   ^^^^^^^^^ not found in `ffi`

error[E0425]: cannot find value `MZ_NO_FLUSH` in module `ffi`
  --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/mem.rs:93:17
   |
93 |     None = ffi::MZ_NO_FLUSH as isize,
   |                 ^^^^^^^^^^^ not found in `ffi`

error[E0425]: cannot find value `MZ_SYNC_FLUSH` in module `ffi`
   --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/mem.rs:102:17
    |
102 |     Sync = ffi::MZ_SYNC_FLUSH as isize,
    |                 ^^^^^^^^^^^^^ not found in `ffi`

error[E0425]: cannot find value `MZ_FINISH` in module `ffi`
   --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/mem.rs:108:19
    |
108 |     Finish = ffi::MZ_FINISH as isize,
    |                   ^^^^^^^^^ not found in `ffi`

error[E0425]: cannot find value `MZ_DEFAULT_WINDOW_BITS` in module `ffi`
   --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/mem.rs:197:59
    |
197 |             inner: Deflate::make(level, zlib_header, ffi::MZ_DEFAULT_WINDOW_BITS as u8),
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^ not found in `ffi`

error[E0425]: cannot find value `MZ_DEFAULT_WINDOW_BITS` in module `ffi`
   --> /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/flate2-1.0.34/src/mem.rs:367:52
    |
367 |             inner: Inflate::make(zlib_header, ffi::MZ_DEFAULT_WINDOW_BITS as u8),
    |                                                    ^^^^^^^^^^^^^^^^^^^^^^ not found in `ffi`

   Compiling syn v2.0.98
   Compiling cc v1.1.30
Some errors have detailed explanations: E0412, E0425, E0432.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `flate2` (lib) due to 13 previous errors
warning: build failed, waiting for other jobs to finish...

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