@@ -1468,45 +1468,39 @@ impl<'a> Builder<'a> {
14681468 rustflags. arg ( "-Zunstable-options" ) ;
14691469 }
14701470
1471- // FIXME(Urgau): This a hack as it shouldn't be gated on stage 0 but until `rustc_llvm`
1472- // is made to work with `--check-cfg` which is currently not easly possible until cargo
1473- // get some support for setting `--check-cfg` within build script, it's the least invasive
1474- // hack that still let's us have cfg checking for the vast majority of the codebase.
1475- if stage != 0 {
1476- // Enable cfg checking of cargo features for everything but std and also enable cfg
1477- // checking of names and values.
1478- //
1479- // Note: `std`, `alloc` and `core` imports some dependencies by #[path] (like
1480- // backtrace, core_simd, std_float, ...), those dependencies have their own
1481- // features but cargo isn't involved in the #[path] process and so cannot pass the
1482- // complete list of features, so for that reason we don't enable checking of
1483- // features for std crates.
1484- cargo. arg ( if mode != Mode :: Std {
1485- "-Zcheck-cfg=names,values,features"
1486- } else {
1487- "-Zcheck-cfg=names,values"
1488- } ) ;
1471+ // Enable cfg checking of cargo features for everything but std and also enable cfg
1472+ // checking of names and values.
1473+ //
1474+ // Note: `std`, `alloc` and `core` imports some dependencies by #[path] (like
1475+ // backtrace, core_simd, std_float, ...), those dependencies have their own
1476+ // features but cargo isn't involved in the #[path] process and so cannot pass the
1477+ // complete list of features, so for that reason we don't enable checking of
1478+ // features for std crates.
1479+ cargo. arg ( if mode != Mode :: Std {
1480+ "-Zcheck-cfg=names,values,output,features"
1481+ } else {
1482+ "-Zcheck-cfg=names,values,output"
1483+ } ) ;
14891484
1490- // Add extra cfg not defined in/by rustc
1491- //
1492- // Note: Altrough it would seems that "-Zunstable-options" to `rustflags` is useless as
1493- // cargo would implicitly add it, it was discover that sometimes bootstrap only use
1494- // `rustflags` without `cargo` making it required.
1495- rustflags. arg ( "-Zunstable-options" ) ;
1496- for ( restricted_mode, name, values) in EXTRA_CHECK_CFGS {
1497- if * restricted_mode == None || * restricted_mode == Some ( mode) {
1498- // Creating a string of the values by concatenating each value:
1499- // ',"tvos","watchos"' or '' (nothing) when there are no values
1500- let values = match values {
1501- Some ( values) => values
1502- . iter ( )
1503- . map ( |val| [ "," , "\" " , val, "\" " ] )
1504- . flatten ( )
1505- . collect :: < String > ( ) ,
1506- None => String :: new ( ) ,
1507- } ;
1508- rustflags. arg ( & format ! ( "--check-cfg=values({name}{values})" ) ) ;
1509- }
1485+ // Add extra cfg not defined in/by rustc
1486+ //
1487+ // Note: Altrough it would seems that "-Zunstable-options" to `rustflags` is useless as
1488+ // cargo would implicitly add it, it was discover that sometimes bootstrap only use
1489+ // `rustflags` without `cargo` making it required.
1490+ rustflags. arg ( "-Zunstable-options" ) ;
1491+ for ( restricted_mode, name, values) in EXTRA_CHECK_CFGS {
1492+ if * restricted_mode == None || * restricted_mode == Some ( mode) {
1493+ // Creating a string of the values by concatenating each value:
1494+ // ',"tvos","watchos"' or '' (nothing) when there are no values
1495+ let values = match values {
1496+ Some ( values) => values
1497+ . iter ( )
1498+ . map ( |val| [ "," , "\" " , val, "\" " ] )
1499+ . flatten ( )
1500+ . collect :: < String > ( ) ,
1501+ None => String :: new ( ) ,
1502+ } ;
1503+ rustflags. arg ( & format ! ( "--check-cfg=values({name}{values})" ) ) ;
15101504 }
15111505 }
15121506
0 commit comments