sparse-registry errors talk about "replaced source registry" #11277
Description
Problem
Errors when sparse-registry is enabled talk about a "replaced source", which I think is confusing. For example:
Updating crates.io index
error: failed to select a version for the requirement `bitflags = "^3"`
candidate versions found which didn't match: 1.3.2, 1.3.1, 1.2.1, ...
location searched: crates.io index (which is replacing registry `crates-io`)
required by package `z20 v0.1.0 (/Users/eric/Temp/z20)`
perhaps a crate was updated and forgotten to be re-vendored?
I think when sparse-registry is enabled that it shouldn't behave as-if it is a replacement. I'm not sure if this is unique to how crates-io is implemented. Is there some way we can work around this?
Steps
Perform an action that would trigger one of the errors in https://github.com/rust-lang/cargo/blob/master/src/cargo/sources/replaced.rs. For example:
cargo new foo
cd foo
echo 'bitflags = "99"' >> Cargo.toml
cargo generate-lockfile -Zsparse-registry
Possible Solution(s)
No response
Notes
cargo 1.66.0-nightly (3ff0443 2022-10-17)
release: 1.66.0-nightly
commit-hash: 3ff0443
commit-date: 2022-10-17
host: x86_64-apple-darwin
libgit2: 1.5.0 (sys:0.15.0 vendored)
libcurl: 7.79.1 (sys:0.4.55+curl-7.83.1 system ssl:(SecureTransport) LibreSSL/3.3.6)
os: Mac OS 12.6.0 [64-bit]
Version
No response