Skip to content

Doesn't compile in WSL with ubuntu 20.04 #2535

Closed
@IceSentry

Description

@IceSentry

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Rust Version

rustc 1.52.1 (9bc8c42bb 2021-05-09)

Clap Version

3.0.0-beta.2

Minimal reproducible code

fn main() {
	println!("Hello, world!");
}

in Cargo.toml

[package]
name = "clap-test"
version = "0.1.0"
authors = ["author"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = "3.0.0-beta.2"

Steps to reproduce the bug with the above code

run cargo build in wsl with ubuntu 20.04

Actual Behaviour

 > cargo build
   Compiling clap v3.0.0-beta.2
error[E0107]: this struct takes 3 type arguments but only 2 type arguments were supplied
  --> /home/<username>/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/clap-3.0.0-beta.2/src/parse/matches/arg_matches.rs:77:22
   |
77 |     pub(crate) args: IndexMap<Id, MatchedArg>,
   |                      ^^^^^^^^ --  ---------- supplied 2 type arguments
   |                      |
   |                      expected 3 type arguments
   |
note: struct defined here, with 3 type parameters: `K`, `V`, `S`
  --> /home/<username>/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/indexmap-1.6.2/src/map.rs:76:12
   |
76 | pub struct IndexMap<K, V, S> {
   |            ^^^^^^^^ -  -  -
help: add missing type argument
   |
77 |     pub(crate) args: IndexMap<Id, MatchedArg, S>,
   |                                             ^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0107`.
error: could not compile `clap`

To learn more, run the command again with --verbose.

Expected Behaviour

Compiles successfully when added as a dependency

Additional Context

I recently completely reinstalled wsl with ubuntu 20.04 and I have nothing but the rust toolchain installed on top of the default installation and anything required to compile rust projects. I can compile other projects that do not use clap. Yes, I ran an apt update and apt upgrade. I tried building a project using clap and saw this output. I then reproduced the bug by adding the dependency to an empty project and I saw the same output of clap not being able to compile.

I know this works correctly in my windows install, but I also compiled that project yesterday in a ubuntu 18.04 not through wsl and it worked.

I'm not sure if the issue is with WSL or ubuntu 20.04

Debug Output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions