romnn/cargo-feature-combinations

Fails to compile on Windows 10 (msvc)

Closed this issue · 2 comments

eddyp commented

When trying to install cargo-feature-combinatons on a Windows 10 system I get compilation errors:

...
  Compiling serde_json_merge v0.0.4
   Compiling cargo-feature-combinations v0.0.15
error[E0599]: `Vec<u8>` is not an iterator
   --> C:\Users\nxa14974\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cargo-feature-combinations-0.0.15\src\lib.rs:436:18
    |
435 |               let output = strip_ansi_escapes::strip(colored_output.get_ref())
    |  __________________________-
436 | |                 .map(|out| String::from_utf8_lossy(&out).into_owned());
    | |                 -^^^ `Vec<u8>` is not an iterator; try calling `.into_iter()` or `.iter()`
    | |_________________|
    |
    |
   ::: C:\Users\nxa14974\.rustup\toolchains\stable-x86_64-pc-windows-msvc\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[E0277]: the size for values of type `[u8]` cannot be known at compilation time
   --> C:\Users\nxa14974\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cargo-feature-combinations-0.0.15\src\lib.rs:436:23
    |
436 |                 .map(|out| String::from_utf8_lossy(&out).into_owned());
    |                       ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[u8]`
help: function arguments must have a statically known size, borrowed types always have a known size
    |
436 |                 .map(|&out| String::from_utf8_lossy(&out).into_owned());
    |                       +

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `cargo-feature-combinations` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-feature-combinations v0.0.15`, intermediate artifacts can be found at `C:\Users\nxa14974\AppData\Local\Temp\1\cargo-installjRSXJt`

System details:

rustc -vV

rustc 1.70.0 (90c541806 2023-05-31)
binary: rustc
commit-hash: 90c541806f23a127002de5b4038be731ba1458ca
commit-date: 2023-05-31
host: x86_64-pc-windows-msvc
release: 1.70.0
LLVM version: 16.0.2

cargo -Vv

cargo 1.70.0 (ec8a8a0ca 2023-04-25)
release: 1.70.0
commit-hash: ec8a8a0cabb0e0cadef58902470f6c7ee7868bdc
commit-date: 2023-04-25
host: x86_64-pc-windows-msvc
libgit2: 1.6.3 (sys:0.17.0 vendored)
libcurl: 8.0.1-DEV (sys:0.4.61+curl-8.0.1 vendored ssl:Schannel)
os: Windows 10.0.19045 (Windows 10 Enterprise) [64-bit]

rustup toolchain list

stable-x86_64-pc-windows-msvc (default)

wez commented

cargo install cargo-feature-combinations --locked works for me in #2

Thanks for reporting the issue.

This problem is fixed by e5ff5ec and released in v0.0.16.