Open crumblingstatue opened 7 years ago
Looks like the error hasn't improved in the intervening time
#!/usr/bin/env nargo
```cargo
[dependencies]
bincode = "=1.0.0-alpha7"
fn main () {}
```console
$ ./cargo-4260.rs
warning: `package.edition` is unspecified, defaulting to `2021`
Updating crates.io index
error: failed to select a version for the requirement `bincode = "=1.0.0-alpha7"`
candidate versions found which didn't match: 2.0.0-rc.3, 2.0.0-rc.2, 2.0.0-rc.1, ...
location searched: crates.io index
required by package `cargo-4260 v0.0.0 (/home/epage/src/personal/dump)`
if you are looking for the prerelease package it needs to be specified explicitly
bincode = { version = "2.0.0-rc.3" }
perhaps a crate was updated and forgotten to be re-vendored?
@Eh2406 how bad would this be to improve the error in this case?
The resolver is reporting that the package doesn't exist, because it got filtered out and a much lower level of abstraction. This is part of the work in https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/better.20error.20messages.20for.20filtered.20versions.2E
Not sure I should open a separate issue, but relatedly, the error from cargo update -p crate --precise yanked-version
says error: no matching package named "crate" found
, which is confusing.
Allowing --precise
with yanked packages was implemented in #13333. It is currently unstable but we expect to stabilize it soon.
Depending on
bincode = "1.0.0-alpha7"
produces the following error:It doesn't mention the fact that there is a
1.0.0-alpha7
, but it has been yanked.This can leave the user confused about whether they mistyped something, or they are just trying to depend on a yanked version.
Semi-related: https://github.com/onur/docs.rs/issues/112#issuecomment-313868337