@@ -182,7 +182,7 @@ impl Metadata {
182
182
}
183
183
184
184
pub ( super ) fn targets ( & self ) -> BuildTargets < ' _ > {
185
- use super :: rustwide_builder:: { HOST_TARGET , TARGETS } ;
185
+ use super :: rustwide_builder:: HOST_TARGET ;
186
186
187
187
let default_target = self
188
188
. default_target
@@ -200,7 +200,7 @@ impl Metadata {
200
200
. targets
201
201
. as_ref ( )
202
202
. map ( |targets| targets. iter ( ) . map ( String :: as_str) . collect ( ) )
203
- . unwrap_or_else ( || TARGETS . iter ( ) . copied ( ) . collect ( ) ) ;
203
+ . unwrap_or_default ( ) ;
204
204
205
205
targets. remove ( & default_target) ;
206
206
BuildTargets {
@@ -302,24 +302,9 @@ mod test {
302
302
let mut metadata = Metadata :: default ( ) ;
303
303
304
304
// unchanged default_target, targets not specified
305
- let BuildTargets {
306
- default_target : default,
307
- other_targets : tier_one,
308
- } = metadata. targets ( ) ;
305
+ let BuildTargets { default_target : default, other_targets } = metadata. targets ( ) ;
309
306
assert_eq ! ( default , HOST_TARGET ) ;
310
-
311
- // should be equal to TARGETS \ {HOST_TARGET}
312
- for actual in & tier_one {
313
- assert ! ( TARGETS . contains( actual) ) ;
314
- }
315
-
316
- for expected in TARGETS {
317
- if * expected == HOST_TARGET {
318
- assert ! ( !tier_one. contains( & HOST_TARGET ) ) ;
319
- } else {
320
- assert ! ( tier_one. contains( expected) ) ;
321
- }
322
- }
307
+ assert ! ( other_targets. is_empty( ) ) ;
323
308
324
309
// unchanged default_target, targets specified to be empty
325
310
metadata. targets = Some ( Vec :: new ( ) ) ;
@@ -392,20 +377,10 @@ mod test {
392
377
assert_eq ! ( default , "i686-apple-darwin" ) ;
393
378
assert ! ( others. is_empty( ) ) ;
394
379
395
- // and if `targets` is unset, it should still be set to `TARGETS`
380
+ // if `targets` is unset, don't build any extra targets
396
381
metadata. targets = None ;
397
- let BuildTargets {
398
- default_target : default,
399
- other_targets : others,
400
- } = metadata. targets ( ) ;
401
-
382
+ let BuildTargets { default_target : default, other_targets } = metadata. targets ( ) ;
402
383
assert_eq ! ( default , "i686-apple-darwin" ) ;
403
- let tier_one_targets_no_default = TARGETS
404
- . iter ( )
405
- . filter ( |& & t| t != "i686-apple-darwin" )
406
- . copied ( )
407
- . collect ( ) ;
408
-
409
- assert_eq ! ( others, tier_one_targets_no_default) ;
384
+ assert ! ( other_targets. is_empty( ) ) ;
410
385
}
411
386
}
0 commit comments