mirror of
https://github.com/rust-lang/cargo
synced 2024-10-30 03:28:38 +00:00
refactor(toml): Move the ws default features function out
This commit is contained in:
parent
738cdeca8b
commit
7f2c7061f1
1 changed files with 17 additions and 16 deletions
|
@ -970,22 +970,6 @@ fn inner_dependency_inherit_with<'a>(
|
|||
package_root: &Path,
|
||||
warnings: &mut Vec<String>,
|
||||
) -> CargoResult<manifest::TomlDependency> {
|
||||
fn deprecated_ws_default_features(
|
||||
label: &str,
|
||||
ws_def_feat: Option<bool>,
|
||||
warnings: &mut Vec<String>,
|
||||
) {
|
||||
let ws_def_feat = match ws_def_feat {
|
||||
Some(true) => "true",
|
||||
Some(false) => "false",
|
||||
None => "not specified",
|
||||
};
|
||||
warnings.push(format!(
|
||||
"`default-features` is ignored for {label}, since `default-features` was \
|
||||
{ws_def_feat} for `workspace.dependencies.{label}`, \
|
||||
this could become a hard error in the future"
|
||||
))
|
||||
}
|
||||
inherit()?.get_dependency(name, package_root).map(|ws_dep| {
|
||||
let mut merged_dep = match ws_dep {
|
||||
manifest::TomlDependency::Simple(ws_version) => manifest::TomlDetailedDependency {
|
||||
|
@ -1044,6 +1028,23 @@ fn inner_dependency_inherit_with<'a>(
|
|||
})
|
||||
}
|
||||
|
||||
fn deprecated_ws_default_features(
|
||||
label: &str,
|
||||
ws_def_feat: Option<bool>,
|
||||
warnings: &mut Vec<String>,
|
||||
) {
|
||||
let ws_def_feat = match ws_def_feat {
|
||||
Some(true) => "true",
|
||||
Some(false) => "false",
|
||||
None => "not specified",
|
||||
};
|
||||
warnings.push(format!(
|
||||
"`default-features` is ignored for {label}, since `default-features` was \
|
||||
{ws_def_feat} for `workspace.dependencies.{label}`, \
|
||||
this could become a hard error in the future"
|
||||
))
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip_all)]
|
||||
fn to_real_manifest(
|
||||
contents: String,
|
||||
|
|
Loading…
Reference in a new issue