mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
Auto merge of #13886 - jneem:vendoring-warning, r=arlosi
Silence the warning about forgetting the vendoring
This commit is contained in:
commit
34a6a87d8a
@ -152,7 +152,7 @@ impl<'gctx> Source for ReplacedSource<'gctx> {
|
||||
}
|
||||
|
||||
fn is_replaced(&self) -> bool {
|
||||
true
|
||||
!self.is_builtin_replacement()
|
||||
}
|
||||
|
||||
fn add_to_yanked_whitelist(&mut self, pkgs: &[PackageId]) {
|
||||
|
@ -146,6 +146,8 @@ pub trait Source {
|
||||
fn describe(&self) -> String;
|
||||
|
||||
/// Returns whether a source is being replaced by another here.
|
||||
///
|
||||
/// Builtin replacement of `crates.io` doesn't count as replacement here.
|
||||
fn is_replaced(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
@ -3833,3 +3833,43 @@ fn builtin_source_replacement() {
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn builtin_source_replacement_no_vendor_error() {
|
||||
// errors for builtin source replacement of crates.io
|
||||
// should not mention outdated vendor dependencies
|
||||
let server = RegistryBuilder::new().build();
|
||||
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
dep = "0.2.0"
|
||||
"#,
|
||||
)
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
let pkg = Package::new("dep", "0.1.0");
|
||||
pkg.publish();
|
||||
|
||||
p.cargo("check -v")
|
||||
.replace_crates_io(&server.index_url())
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
[UPDATING] [..] index
|
||||
[ERROR] failed to select a version for the requirement `dep = \"^0.2.0\"`
|
||||
candidate versions found which didn't match: 0.1.0
|
||||
location searched: crates.io index
|
||||
required by package `foo v0.0.1 ([..])`
|
||||
",
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user