@@ -413,20 +413,16 @@ impl Features {
413
413
warnings : & mut Vec < String > ,
414
414
) -> CargoResult < Features > {
415
415
let mut ret = Features :: default ( ) ;
416
+ ret. nightly_features_allowed = config. nightly_features_allowed ;
416
417
for feature in features {
417
- ret. add ( feature, config , warnings) ?;
418
+ ret. add ( feature, warnings) ?;
418
419
ret. activated . push ( feature. to_string ( ) ) ;
419
420
}
420
- ret. nightly_features_allowed = config. nightly_features_allowed ;
421
421
Ok ( ret)
422
422
}
423
423
424
- fn add (
425
- & mut self ,
426
- feature_name : & str ,
427
- config : & Config ,
428
- warnings : & mut Vec < String > ,
429
- ) -> CargoResult < ( ) > {
424
+ fn add ( & mut self , feature_name : & str , warnings : & mut Vec < String > ) -> CargoResult < ( ) > {
425
+ let nightly_features_allowed = self . nightly_features_allowed ;
430
426
let ( slot, feature) = match self . status ( feature_name) {
431
427
Some ( p) => p,
432
428
None => bail ! ( "unknown cargo feature `{}`" , feature_name) ,
@@ -464,7 +460,7 @@ impl Features {
464
460
) ;
465
461
warnings. push ( warning) ;
466
462
}
467
- Status :: Unstable if !config . nightly_features_allowed => bail ! (
463
+ Status :: Unstable if !nightly_features_allowed => bail ! (
468
464
"the cargo feature `{}` requires a nightly version of \
469
465
Cargo, but this is the `{}` channel\n \
470
466
{}\n {}",
0 commit comments