mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Group logic for fields dependent on package
I'm somewhat tempted to flatten the function call. The parallel between the package an virtual-manifest cases would help to keep them in sync.
This commit is contained in:
parent
9eb7c09463
commit
7640081cda
@ -645,6 +645,10 @@ fn resolve_toml(
|
||||
.map(|mw| field_inherit_with(mw, "badges", || inherit()?.badges()))
|
||||
.transpose()?;
|
||||
resolved_toml.badges = resolved_badges.map(manifest::InheritableField::Value);
|
||||
} else {
|
||||
for field in original_toml.requires_package() {
|
||||
bail!("this virtual manifest specifies a `{field}` section, which is not allowed");
|
||||
}
|
||||
}
|
||||
|
||||
Ok(resolved_toml)
|
||||
@ -1513,10 +1517,6 @@ fn to_virtual_manifest(
|
||||
) -> CargoResult<VirtualManifest> {
|
||||
let root = manifest_file.parent().unwrap();
|
||||
|
||||
for field in original_toml.requires_package() {
|
||||
bail!("this virtual manifest specifies a `{field}` section, which is not allowed");
|
||||
}
|
||||
|
||||
let mut deps = Vec::new();
|
||||
let (replace, patch) = {
|
||||
let mut manifest_ctx = ManifestContext {
|
||||
|
Loading…
x
Reference in New Issue
Block a user