TimonPost / cargo-unused-features

Find potential unused enabled feature flags and prune them.
MIT License
230 stars 10 forks source link

0.2.0 fails to build with rustc 1.71.1 #14

Open linsallyzhao opened 1 year ago

linsallyzhao commented 1 year ago
% rustc --version
rustc 1.71.1 (eb26296b5 2023-08-03)
% cargo install cargo-unused-features
[...]
error[E0599]: `Vec<u8>` is not an iterator
   --> /home/lin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.68.0/src/cargo/core/compiler/future_incompat.rs:228:18
    |
227 | /             strip_ansi_escapes::strip(&to_display)
228 | |                 .map(|v| String::from_utf8(v).expect("utf8"))
    | |                 -^^^ `Vec<u8>` is not an iterator; try calling `.into_iter()` or `.iter()`
    | |_________________|
    | 
    |
   ::: /home/lin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:396:1
    |
396 |   pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    |   ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<u8>: Iterator`
    |
    = note: the following trait bounds were not satisfied:
            `Vec<u8>: Iterator`
            which is required by `&mut Vec<u8>: Iterator`
            `[u8]: Iterator`
            which is required by `&mut [u8]: Iterator`

error[E0599]: `Vec<u8>` is not an iterator
    --> /home/lin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.68.0/src/cargo/core/compiler/mod.rs:1514:26
     |
1513 | /                     strip_ansi_escapes::strip(&msg.rendered)
1514 | |                         .map(|v| String::from_utf8(v).expect("utf8"))
     | |                         -^^^ `Vec<u8>` is not an iterator; try calling `.into_iter()` or `.iter()`
     | |_________________________|
     | 
     |
    ::: /home/lin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:396:1
     |
396  |   pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
     |   ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<u8>: Iterator`
     |
     = note: the following trait bounds were not satisfied:
             `Vec<u8>: Iterator`
             which is required by `&mut Vec<u8>: Iterator`
             `[u8]: Iterator`
             which is required by `&mut [u8]: Iterator`

error[E0599]: `Vec<u8>` is not an iterator
    --> /home/lin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.68.0/src/cargo/core/compiler/mod.rs:1548:22
     |
1547 |                   error.rendered = strip_ansi_escapes::strip(&error.rendered)
     |  __________________________________-
1548 | |                     .map(|v| String::from_utf8(v).expect("utf8"))
     | |                     -^^^ `Vec<u8>` is not an iterator; try calling `.into_iter()` or `.iter()`
     | |_____________________|
     | 
     |
    ::: /home/lin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:396:1
     |
396  |   pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
     |   ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<u8>: Iterator`
     |
     = note: the following trait bounds were not satisfied:
             `Vec<u8>: Iterator`
             which is required by `&mut Vec<u8>: Iterator`
             `[u8]: Iterator`
             which is required by `&mut [u8]: Iterator`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `cargo` (lib) due to 3 previous errors
error: failed to compile `cargo-unused-features v0.2.0`, intermediate artifacts can be found at `/tmp/cargo-installQnrMA3`
TimonPost commented 1 year ago

oh! Will have a look soon and yank version

TimonPost commented 1 year ago

I am not sure if this is an issue of this library. Using this rust version and latest published crate binary works fine for me. Try reinstalling the binary