Skip to content

Commit b5177c6

Browse files
committed
Auto merge of #12001 - hi-rustin:rustin-patch-dep-empty, r=weihanglo
Improve error message for empty dep
2 parents 39a972d + af0cd9f commit b5177c6

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/cargo/util/toml/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,8 +2997,8 @@ impl<P: ResolveToPath + Clone> DetailedTomlDependency<P> {
29972997
if self.version.is_none() && self.path.is_none() && self.git.is_none() {
29982998
let msg = format!(
29992999
"dependency ({}) specified without \
3000-
providing a local path, Git repository, or \
3001-
version to use. This will be considered an \
3000+
providing a local path, Git repository, version, or \
3001+
workspace dependency to use. This will be considered an \
30023002
error in future versions",
30033003
name_in_toml
30043004
);

tests/testsuite/bad_config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,8 @@ fn empty_dependencies() {
780780
p.cargo("check")
781781
.with_stderr_contains(
782782
"\
783-
warning: dependency (bar) specified without providing a local path, Git repository, or version \
784-
to use. This will be considered an error in future versions
783+
warning: dependency (bar) specified without providing a local path, Git repository, version, \
784+
or workspace dependency to use. This will be considered an error in future versions
785785
",
786786
)
787787
.run();

tests/testsuite/inheritable_workspace_fields.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,9 @@ fn error_workspace_dependency_looked_for_workspace_itself() {
12691269
.with_stderr(
12701270
"\
12711271
[WARNING] [CWD]/Cargo.toml: unused manifest key: workspace.dependencies.dep.workspace
1272-
[WARNING] [CWD]/Cargo.toml: dependency (dep) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions
1272+
[WARNING] [CWD]/Cargo.toml: dependency (dep) specified without providing a local path, Git repository, version, \
1273+
or workspace dependency to use. \
1274+
This will be considered an error in future versions
12731275
[UPDATING] `dummy-registry` index
12741276
[ERROR] no matching package named `dep` found
12751277
location searched: registry `crates-io`
@@ -1589,7 +1591,9 @@ fn cannot_inherit_in_patch() {
15891591
.with_stderr(
15901592
"\
15911593
[WARNING] [CWD]/Cargo.toml: unused manifest key: patch.crates-io.bar.workspace
1592-
[WARNING] [CWD]/Cargo.toml: dependency (bar) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions
1594+
[WARNING] [CWD]/Cargo.toml: dependency (bar) specified without providing a local path, Git repository, version, \
1595+
or workspace dependency to use. \
1596+
This will be considered an error in future versions
15931597
[UPDATING] `dummy-registry` index
15941598
[ERROR] failed to resolve patches for `https://github.com/rust-lang/crates.io-index`
15951599

0 commit comments

Comments
 (0)