mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
refactor(toml): Prefer making a Manifest from resolved_toml
This commit is contained in:
parent
7640081cda
commit
70ad920e74
@ -925,7 +925,7 @@ pub fn to_real_manifest(
|
|||||||
|
|
||||||
let resolve_behavior = match (
|
let resolve_behavior = match (
|
||||||
resolved_package.resolver.as_ref(),
|
resolved_package.resolver.as_ref(),
|
||||||
original_toml
|
resolved_toml
|
||||||
.workspace
|
.workspace
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|ws| ws.resolver.as_ref()),
|
.and_then(|ws| ws.resolver.as_ref()),
|
||||||
@ -942,7 +942,7 @@ pub fn to_real_manifest(
|
|||||||
// If we have a lib with no path, use the inferred lib or else the package name.
|
// If we have a lib with no path, use the inferred lib or else the package name.
|
||||||
let targets = targets(
|
let targets = targets(
|
||||||
&features,
|
&features,
|
||||||
&original_toml,
|
&resolved_toml,
|
||||||
package_name,
|
package_name,
|
||||||
package_root,
|
package_root,
|
||||||
edition,
|
edition,
|
||||||
@ -1107,8 +1107,8 @@ pub fn to_real_manifest(
|
|||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let replace = replace(&original_toml, &mut manifest_ctx)?;
|
let replace = replace(&resolved_toml, &mut manifest_ctx)?;
|
||||||
let patch = patch(&original_toml, &mut manifest_ctx)?;
|
let patch = patch(&resolved_toml, &mut manifest_ctx)?;
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut names_sources = BTreeMap::new();
|
let mut names_sources = BTreeMap::new();
|
||||||
@ -1179,7 +1179,7 @@ pub fn to_real_manifest(
|
|||||||
rust_version: rust_version.clone(),
|
rust_version: rust_version.clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(profiles) = &original_toml.profile {
|
if let Some(profiles) = &resolved_toml.profile {
|
||||||
let cli_unstable = gctx.cli_unstable();
|
let cli_unstable = gctx.cli_unstable();
|
||||||
validate_profiles(profiles, cli_unstable, &features, warnings)?;
|
validate_profiles(profiles, cli_unstable, &features, warnings)?;
|
||||||
}
|
}
|
||||||
@ -1211,7 +1211,7 @@ pub fn to_real_manifest(
|
|||||||
let summary = Summary::new(
|
let summary = Summary::new(
|
||||||
pkgid,
|
pkgid,
|
||||||
deps,
|
deps,
|
||||||
&original_toml
|
&resolved_toml
|
||||||
.features
|
.features
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.unwrap_or(&Default::default())
|
.unwrap_or(&Default::default())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user