mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Look at FeaturesFor:: to decide if a dependency participates in feature resolution
Fixes #10431.
This commit is contained in:
parent
ac6427f755
commit
1190f5fea2
@ -769,6 +769,12 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
|
||||
.target_data
|
||||
.dep_platform_activated(dep, CompileKind::Host);
|
||||
}
|
||||
// We always count platforms as activated if the target stems from an artifact
|
||||
// dependency's target specification. This triggers in conjunction with
|
||||
// `[target.'cfg(…)'.dependencies]` manifest sections.
|
||||
if matches!(fk, FeaturesFor::NormalOrDevOrArtifactTarget(Some(_))) {
|
||||
return true;
|
||||
}
|
||||
// Not a build dependency, and not for a build script, so must be Target.
|
||||
self.requested_targets
|
||||
.iter()
|
||||
|
@ -426,7 +426,6 @@ fn features_are_not_unified_among_lib_and_bin_dep_of_different_target() {
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
#[ignore]
|
||||
fn feature_resolution_works_for_cfg_target_specification() {
|
||||
if cross_compile::disabled() {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user