mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Make the dependency specification ambiguous be an error
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
parent
66a6737a0c
commit
85ba14c68d
@ -1791,13 +1791,11 @@ impl<P: ResolveToPath> DetailedTomlDependency<P> {
|
|||||||
),
|
),
|
||||||
(Some(git), maybe_path, _, _) => {
|
(Some(git), maybe_path, _, _) => {
|
||||||
if maybe_path.is_some() {
|
if maybe_path.is_some() {
|
||||||
let msg = format!(
|
bail!(
|
||||||
"dependency ({}) specification is ambiguous. \
|
"dependency ({}) specification is ambiguous. \
|
||||||
Only one of `git` or `path` is allowed. \
|
Only one of `git` or `path` is allowed.",
|
||||||
This will be considered an error in future versions",
|
|
||||||
name_in_toml
|
name_in_toml
|
||||||
);
|
);
|
||||||
cx.warnings.push(msg)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let n_details = [&self.branch, &self.tag, &self.rev]
|
let n_details = [&self.branch, &self.tag, &self.rev]
|
||||||
|
@ -1112,11 +1112,12 @@ fn both_git_and_path_specified() {
|
|||||||
|
|
||||||
foo.cargo("build -v")
|
foo.cargo("build -v")
|
||||||
.with_status(101)
|
.with_status(101)
|
||||||
.with_stderr_contains(
|
.with_stderr(
|
||||||
"\
|
"\
|
||||||
[WARNING] dependency (bar) specification is ambiguous. \
|
error: failed to parse manifest at `[..]`
|
||||||
Only one of `git` or `path` is allowed. \
|
|
||||||
This will be considered an error in future versions
|
Caused by:
|
||||||
|
dependency (bar) specification is ambiguous. Only one of `git` or `path` is allowed.
|
||||||
",
|
",
|
||||||
)
|
)
|
||||||
.run();
|
.run();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user