mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Auto merge of #14700 - kornelski:patchdash, r=weihanglo
Help with [patch.crates.io] This catches a syntactical mistake in TOML that's easy to make by patching `[patch.crates.io]` instead of `[patch.crates-io]`. ```diff error: failed to parse manifest at `Cargo.toml` Caused by: [patch] entry `crates` should be a URL or registry name + For crates.io, use [patch.crates-io] (with a dash) Caused by: invalid url `crates`: relative URL without a base ```
This commit is contained in:
commit
6f92aaa31f
@ -1892,8 +1892,13 @@ fn patch(
|
|||||||
.or_else(|_| toml_url.into_url())
|
.or_else(|_| toml_url.into_url())
|
||||||
.with_context(|| {
|
.with_context(|| {
|
||||||
format!(
|
format!(
|
||||||
"[patch] entry `{}` should be a URL or registry name",
|
"[patch] entry `{}` should be a URL or registry name{}",
|
||||||
toml_url
|
toml_url,
|
||||||
|
if toml_url == "crates" {
|
||||||
|
"\nFor crates.io, use [patch.crates-io] (with a dash)"
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
}
|
||||||
)
|
)
|
||||||
})?,
|
})?,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user