cargo: Latest released version does not compile

Problem

The cargo library doesn’t build at 0.50.0 (latest released version) and 0.52.0. However it does at master.

Steps

  1. git checkout 67a00f95b (supposedly 0.50.0) or git checkout 60143816b (supposedly 0.52.0)
  2. cargo build --release --lib
  3. The following error is displayed:
error[E0283]: type annotations needed
   --> src/cargo/util/config/de.rs:530:63
    |
530 |                 seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
    |                                                           ----^^^^^^--
    |                                                           |   |
    |                                                           |   cannot infer type for type parameter `T` declared on the trait `AsRef`
    |                                                           this method call resolves to `&T`
    |
    = note: cannot satisfy `std::string::String: AsRef<_>`
help: use the fully qualified path for the potential candidates
    |
530 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<OsStr>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
530 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<std::path::Path>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
530 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<str>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
530 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<[u8]>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

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

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

Possible Solution(s)

Bump and release version 0.53.0.

Notes

Output of cargo version: cargo 1.51.0-nightly (c3abcfe8a 2021-01-25) Output of rustc version: rustc 1.51.0-nightly (04caa632d 2021-01-30)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 16 (11 by maintainers)

Commits related to this issue

Most upvoted comments

You can also try if cargo install --locked works for you.

0.50.1 is out now (and the latest released version). I confirm that running cargo update on cargo-udeps does not break the build any more.

We discussed it in today’s Cargo meeting. We are good to do a patch release of the library when a PR bacporting #9101 is merged.