@@ -378,7 +378,7 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
378
378
for ( member, requested_features) in & member_features {
379
379
let fvs = self . fvs_from_requested ( member. package_id ( ) , requested_features) ;
380
380
let for_host = self . track_for_host && self . is_proc_macro ( member. package_id ( ) ) ;
381
- self . activate_pkg ( member. package_id ( ) , & fvs , for_host ) ?;
381
+ self . activate_pkg ( member. package_id ( ) , for_host , & fvs ) ?;
382
382
if for_host {
383
383
// Also activate without for_host. This is needed if the
384
384
// proc-macro includes other targets (like binaries or tests),
@@ -387,7 +387,7 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
387
387
// `--workspace`), this forces feature unification with normal
388
388
// dependencies. This is part of the bigger problem where
389
389
// features depend on which packages are built.
390
- self . activate_pkg ( member. package_id ( ) , & fvs , false ) ?;
390
+ self . activate_pkg ( member. package_id ( ) , false , & fvs ) ?;
391
391
}
392
392
}
393
393
Ok ( ( ) )
@@ -396,8 +396,8 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
396
396
fn activate_pkg (
397
397
& mut self ,
398
398
pkg_id : PackageId ,
399
- fvs : & [ FeatureValue ] ,
400
399
for_host : bool ,
400
+ fvs : & [ FeatureValue ] ,
401
401
) -> CargoResult < ( ) > {
402
402
// Add an empty entry to ensure everything is covered. This is intended for
403
403
// finding bugs where the resolver missed something it should have visited.
@@ -406,7 +406,7 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
406
406
. entry ( ( pkg_id, self . opts . decouple_host_deps && for_host) )
407
407
. or_insert_with ( BTreeSet :: new) ;
408
408
for fv in fvs {
409
- self . activate_fv ( pkg_id, fv , for_host ) ?;
409
+ self . activate_fv ( pkg_id, for_host , fv ) ?;
410
410
}
411
411
if !self . processed_deps . insert ( ( pkg_id, for_host) ) {
412
412
// Already processed dependencies. There's no need to process them
@@ -433,7 +433,7 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
433
433
}
434
434
// Recurse into the dependency.
435
435
let fvs = self . fvs_from_dependency ( dep_pkg_id, dep) ;
436
- self . activate_pkg ( dep_pkg_id, & fvs , dep_for_host ) ?;
436
+ self . activate_pkg ( dep_pkg_id, dep_for_host , & fvs ) ?;
437
437
}
438
438
}
439
439
Ok ( ( ) )
@@ -443,12 +443,12 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
443
443
fn activate_fv (
444
444
& mut self ,
445
445
pkg_id : PackageId ,
446
- fv : & FeatureValue ,
447
446
for_host : bool ,
447
+ fv : & FeatureValue ,
448
448
) -> CargoResult < ( ) > {
449
449
match fv {
450
450
FeatureValue :: Feature ( f) => {
451
- self . activate_rec ( pkg_id, * f , for_host ) ?;
451
+ self . activate_rec ( pkg_id, for_host , * f ) ?;
452
452
}
453
453
FeatureValue :: Dep { dep_name } => {
454
454
// Mark this dependency as activated.
@@ -463,7 +463,7 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
463
463
continue ;
464
464
}
465
465
let fvs = self . fvs_from_dependency ( dep_pkg_id, dep) ;
466
- self . activate_pkg ( dep_pkg_id, & fvs , dep_for_host ) ?;
466
+ self . activate_pkg ( dep_pkg_id, dep_for_host , & fvs ) ?;
467
467
}
468
468
}
469
469
}
@@ -483,17 +483,17 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
483
483
let fv = FeatureValue :: Dep {
484
484
dep_name : * dep_name,
485
485
} ;
486
- self . activate_fv ( pkg_id, & fv , for_host ) ?;
486
+ self . activate_fv ( pkg_id, for_host , & fv ) ?;
487
487
if !dep_prefix {
488
488
// To retain compatibility with old behavior,
489
489
// this also enables a feature of the same
490
490
// name.
491
- self . activate_rec ( pkg_id, * dep_name , for_host ) ?;
491
+ self . activate_rec ( pkg_id, for_host , * dep_name ) ?;
492
492
}
493
493
}
494
494
// Activate the feature on the dependency.
495
495
let fv = FeatureValue :: new ( * dep_feature) ;
496
- self . activate_fv ( dep_pkg_id, & fv , dep_for_host ) ?;
496
+ self . activate_fv ( dep_pkg_id, dep_for_host , & fv ) ?;
497
497
}
498
498
}
499
499
}
@@ -506,8 +506,8 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
506
506
fn activate_rec (
507
507
& mut self ,
508
508
pkg_id : PackageId ,
509
- feature_to_enable : InternedString ,
510
509
for_host : bool ,
510
+ feature_to_enable : InternedString ,
511
511
) -> CargoResult < ( ) > {
512
512
let enabled = self
513
513
. activated_features
@@ -534,7 +534,7 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
534
534
}
535
535
} ;
536
536
for fv in fvs {
537
- self . activate_fv ( pkg_id, fv , for_host ) ?;
537
+ self . activate_fv ( pkg_id, for_host , fv ) ?;
538
538
}
539
539
Ok ( ( ) )
540
540
}
0 commit comments