Skip to content

Commit 6f92aaa

Browse files
committed
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 ```
2 parents 2835ddc + b07c611 commit 6f92aaa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/cargo/util/toml/mod.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1892,8 +1892,13 @@ fn patch(
18921892
.or_else(|_| toml_url.into_url())
18931893
.with_context(|| {
18941894
format!(
1895-
"[patch] entry `{}` should be a URL or registry name",
1896-
toml_url
1895+
"[patch] entry `{}` should be a URL or registry name{}",
1896+
toml_url,
1897+
if toml_url == "crates" {
1898+
"\nFor crates.io, use [patch.crates-io] (with a dash)"
1899+
} else {
1900+
""
1901+
}
18971902
)
18981903
})?,
18991904
};

0 commit comments

Comments
 (0)