Skip to content

Commit 85ba14c

Browse files
committed
Make the dependency specification ambiguous be an error
Signed-off-by: hi-rustin <[email protected]>
1 parent 66a6737 commit 85ba14c

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/cargo/util/toml/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1791,13 +1791,11 @@ impl<P: ResolveToPath> DetailedTomlDependency<P> {
17911791
),
17921792
(Some(git), maybe_path, _, _) => {
17931793
if maybe_path.is_some() {
1794-
let msg = format!(
1794+
bail!(
17951795
"dependency ({}) specification is ambiguous. \
1796-
Only one of `git` or `path` is allowed. \
1797-
This will be considered an error in future versions",
1796+
Only one of `git` or `path` is allowed.",
17981797
name_in_toml
17991798
);
1800-
cx.warnings.push(msg)
18011799
}
18021800

18031801
let n_details = [&self.branch, &self.tag, &self.rev]

tests/testsuite/bad_config.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1112,11 +1112,12 @@ fn both_git_and_path_specified() {
11121112

11131113
foo.cargo("build -v")
11141114
.with_status(101)
1115-
.with_stderr_contains(
1115+
.with_stderr(
11161116
"\
1117-
[WARNING] dependency (bar) specification is ambiguous. \
1118-
Only one of `git` or `path` is allowed. \
1119-
This will be considered an error in future versions
1117+
error: failed to parse manifest at `[..]`
1118+
1119+
Caused by:
1120+
dependency (bar) specification is ambiguous. Only one of `git` or `path` is allowed.
11201121
",
11211122
)
11221123
.run();

0 commit comments

Comments
 (0)