Closed JakubOnderka closed 6 months ago
Unused import is considered as hard fail for current beta and nightly
% cargo +nightly test --features zlib Compiling flate2 v1.0.28 (/Users/jakub/dev/rust/flate2-rs) error: unused import: `libz::Z_BLOCK as MZ_BLOCK` --> src/ffi/c.rs:384:13 | 384 | pub use libz::Z_BLOCK as MZ_BLOCK; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> src/lib.rs:96:24 | 96 | #![cfg_attr(test, deny(warnings))] | ^^^^^^^^ = note: `#[deny(unused_imports)]` implied by `#[deny(warnings)]` warning: unused import: `libz::Z_BLOCK as MZ_BLOCK` --> src/ffi/c.rs:384:13 | 384 | pub use libz::Z_BLOCK as MZ_BLOCK; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: `flate2` (lib) generated 1 warning (run `cargo fix --lib -p flate2` to apply 1 suggestion) error: could not compile `flate2` (lib test) due to 1 previous error
Thanks a lot for the fix!
Since it's truly unused, I wonder if it rather should be removed then allowed, but the comment on the module makes me think there is some deeper purpose. So better play it safe.
Unused import is considered as hard fail for current beta and nightly