@@ -1240,51 +1240,49 @@ impl<'cfg> Workspace<'cfg> {
1240
1240
}
1241
1241
}
1242
1242
1243
- let ms: Vec < _ > = self
1244
- . members ( )
1245
- . filter_map ( |member| {
1246
- let member_id = member. package_id ( ) ;
1247
- match self . current_opt ( ) {
1248
- // The features passed on the command-line only apply to
1249
- // the "current" package (determined by the cwd).
1250
- Some ( current) if member_id == current. package_id ( ) => {
1243
+ let ms: Vec < _ > = self . members ( ) . filter_map ( |member| {
1244
+ let member_id = member. package_id ( ) ;
1245
+ match self . current_opt ( ) {
1246
+ // The features passed on the command-line only apply to
1247
+ // the "current" package (determined by the cwd).
1248
+ Some ( current) if member_id == current. package_id ( ) => {
1249
+ let feats = CliFeatures {
1250
+ features : Rc :: new ( cwd_features. clone ( ) ) ,
1251
+ all_features : cli_features. all_features ,
1252
+ uses_default_features : cli_features. uses_default_features ,
1253
+ } ;
1254
+ Some ( ( member, feats) )
1255
+ }
1256
+ _ => {
1257
+ // Ignore members that are not enabled on the command-line.
1258
+ if specs. iter ( ) . any ( |spec| spec. matches ( member_id) ) {
1259
+ // -p for a workspace member that is not the "current"
1260
+ // one.
1261
+ //
1262
+ // The odd behavior here is due to backwards
1263
+ // compatibility. `--features` and
1264
+ // `--no-default-features` used to only apply to the
1265
+ // "current" package. As an extension, this allows
1266
+ // member-name/feature-name to set member-specific
1267
+ // features, which should be backwards-compatible.
1251
1268
let feats = CliFeatures {
1252
- features : Rc :: new ( cwd_features. clone ( ) ) ,
1269
+ features : Rc :: new (
1270
+ member_specific_features
1271
+ . remove ( member. name ( ) . as_str ( ) )
1272
+ . unwrap_or_default ( ) ,
1273
+ ) ,
1274
+ uses_default_features : true ,
1253
1275
all_features : cli_features. all_features ,
1254
- uses_default_features : cli_features. uses_default_features ,
1255
1276
} ;
1256
1277
Some ( ( member, feats) )
1257
- }
1258
- _ => {
1259
- // Ignore members that are not enabled on the command-line.
1260
- if specs. iter ( ) . any ( |spec| spec. matches ( member_id) ) {
1261
- // -p for a workspace member that is not the "current"
1262
- // one.
1263
- //
1264
- // The odd behavior here is due to backwards
1265
- // compatibility. `--features` and
1266
- // `--no-default-features` used to only apply to the
1267
- // "current" package. As an extension, this allows
1268
- // member-name/feature-name to set member-specific
1269
- // features, which should be backwards-compatible.
1270
- let feats = CliFeatures {
1271
- features : Rc :: new (
1272
- member_specific_features
1273
- . remove ( member. name ( ) . as_str ( ) )
1274
- . unwrap_or_default ( ) ,
1275
- ) ,
1276
- uses_default_features : true ,
1277
- all_features : cli_features. all_features ,
1278
- } ;
1279
- Some ( ( member, feats) )
1280
- } else {
1281
- // This member was not requested on the command-line, skip.
1282
- None
1283
- }
1278
+ } else {
1279
+ // This member was not requested on the command-line, skip.
1280
+ None
1284
1281
}
1285
1282
}
1286
- } )
1287
- . collect ( ) ;
1283
+ }
1284
+ } )
1285
+ . collect ( ) ;
1288
1286
1289
1287
// If any member specific features were not removed while iterating over members
1290
1288
// some features will be ignored.
0 commit comments