mirror of
https://github.com/rust-lang/cargo
synced 2024-10-01 21:43:45 +00:00
Fix panic on ignored target dependency.
This commit is contained in:
parent
c446c2001a
commit
fab135885c
|
@ -1861,8 +1861,7 @@ impl TomlManifest {
|
|||
None,
|
||||
&workspace_config,
|
||||
&inherit_cell,
|
||||
)
|
||||
.unwrap();
|
||||
)?;
|
||||
if platform.build_dependencies.is_some() && platform.build_dependencies2.is_some() {
|
||||
warn_on_deprecated("build-dependencies", name, "platform target", cx.warnings);
|
||||
}
|
||||
|
@ -1876,8 +1875,7 @@ impl TomlManifest {
|
|||
Some(DepKind::Build),
|
||||
&workspace_config,
|
||||
&inherit_cell,
|
||||
)
|
||||
.unwrap();
|
||||
)?;
|
||||
if platform.dev_dependencies.is_some() && platform.dev_dependencies2.is_some() {
|
||||
warn_on_deprecated("dev-dependencies", name, "platform target", cx.warnings);
|
||||
}
|
||||
|
@ -1891,8 +1889,7 @@ impl TomlManifest {
|
|||
Some(DepKind::Development),
|
||||
&workspace_config,
|
||||
&inherit_cell,
|
||||
)
|
||||
.unwrap();
|
||||
)?;
|
||||
target.insert(
|
||||
name.clone(),
|
||||
TomlPlatform {
|
||||
|
|
|
@ -1141,16 +1141,32 @@ fn ignored_git_revision() {
|
|||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
foo.cargo("build -v")
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
let err_msg = "\
|
||||
error: failed to parse manifest at `[..]`
|
||||
|
||||
Caused by:
|
||||
key `branch` is ignored for dependency (bar).
|
||||
",
|
||||
)
|
||||
";
|
||||
foo.cargo("build -v")
|
||||
.with_status(101)
|
||||
.with_stderr(err_msg)
|
||||
.run();
|
||||
|
||||
// #11540, check that [target] dependencies fail the same way.
|
||||
foo.change_file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.0"
|
||||
|
||||
[target.some-target.dependencies]
|
||||
bar = { path = "bar", branch = "spam" }
|
||||
"#,
|
||||
);
|
||||
foo.cargo("build")
|
||||
.with_status(101)
|
||||
.with_stderr(err_msg)
|
||||
.run();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue