@@ -1401,8 +1401,8 @@ impl<'a> Builder<'a> {
14011401 rustflags. arg ( "-Zunstable-options" ) ;
14021402 }
14031403
1404- // #[cfg(bootstrap)] should remove every code path where it's false
1405- const USE_NEW_CHECK_CFG_SYNTAX : bool = false ;
1404+ // #[cfg(bootstrap)]
1405+ let use_new_check_cfg_syntax = self . local_rebuild ;
14061406
14071407 // Enable compile-time checking of `cfg` names, values and Cargo `features`.
14081408 //
@@ -1411,7 +1411,7 @@ impl<'a> Builder<'a> {
14111411 // features but cargo isn't involved in the #[path] process and so cannot pass the
14121412 // complete list of features, so for that reason we don't enable checking of
14131413 // features for std crates.
1414- if USE_NEW_CHECK_CFG_SYNTAX {
1414+ if use_new_check_cfg_syntax {
14151415 cargo. arg ( "-Zcheck-cfg" ) ;
14161416 if mode == Mode :: Std {
14171417 rustflags. arg ( "--check-cfg=cfg(feature,values(any()))" ) ;
@@ -1442,7 +1442,7 @@ impl<'a> Builder<'a> {
14421442 . collect :: < String > ( ) ,
14431443 None => String :: new ( ) ,
14441444 } ;
1445- if USE_NEW_CHECK_CFG_SYNTAX {
1445+ if use_new_check_cfg_syntax {
14461446 let values = values. strip_prefix ( "," ) . unwrap_or ( & values) ; // remove the first `,`
14471447 rustflags. arg ( & format ! ( "--check-cfg=cfg({name},values({values}))" ) ) ;
14481448 } else {
@@ -1463,7 +1463,7 @@ impl<'a> Builder<'a> {
14631463 // We also declare that the flag is expected, which we need to do to not
14641464 // get warnings about it being unexpected.
14651465 hostflags. arg ( "-Zunstable-options" ) ;
1466- if USE_NEW_CHECK_CFG_SYNTAX {
1466+ if use_new_check_cfg_syntax {
14671467 hostflags. arg ( "--check-cfg=cfg(bootstrap)" ) ;
14681468 } else {
14691469 hostflags. arg ( "--check-cfg=values(bootstrap)" ) ;
0 commit comments