You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When given an invalid version for a package that exists, Cargo produces the following error:
error: no matching package named `rayon` found
This is confusing, as it makes it sound like the package name is incorrect, rather than the version.
Steps
$ cargo init foo
Creating binary (application) package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
$ cd foo
$ cargo add rayon
Updating crates.io index
Adding rayon v1.10.0 to dependencies
Features:
- web_spin_lock
Updating crates.io index
Locking 6 packages to latest compatible versions
$ cargo update -p rayon --precise 1.13.0
Updating crates.io index
error: no matching package named `rayon` found
location searched: registry `crates-io`
required by package `foo v0.1.0 (/home/wilfred/tmp/foo)`
Possible Solution(s)
The error message would ideally mention the package version being a problem.
We've improved the version with rejected reason in #14927 like this:
[UPDATING] `dummy-registry` index
[ERROR] failed to select a version for the requirement `foo = "^0.1.1"`
version 0.1.3 requires cargo 1.2345
version 0.1.4 requires a Cargo version that supports index version 1000000000
version 0.1.5's index entry is invalid
version 0.1.6 requires a Cargo version that supports index version 1000000000
version 0.1.7's index entry is invalid
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
Problem
When given an invalid version for a package that exists, Cargo produces the following error:
This is confusing, as it makes it sound like the package name is incorrect, rather than the version.
Steps
Possible Solution(s)
The error message would ideally mention the package version being a problem.
Version
The text was updated successfully, but these errors were encountered: