@@ -21,7 +21,7 @@ use crate::core::config::{DryRun, SplitDebuginfo, TargetSelection};
2121use crate :: prepare_behaviour_dump_dir;
2222use crate :: utils:: cache:: { Cache , Interned , INTERNER } ;
2323use crate :: utils:: helpers:: { self , add_dylib_path, add_link_lib_path, exe, linker_args} ;
24- use crate :: utils:: helpers:: { libdir, linker_flags, output, t, LldThreads } ;
24+ use crate :: utils:: helpers:: { check_cfg_arg , libdir, linker_flags, output, t, LldThreads } ;
2525use crate :: EXTRA_CHECK_CFGS ;
2626use crate :: { Build , CLang , Crate , DocTests , GitRepo , Mode } ;
2727
@@ -1467,23 +1467,7 @@ impl<'a> Builder<'a> {
14671467 rustflags. arg ( "-Zunstable-options" ) ;
14681468 for ( restricted_mode, name, values) in EXTRA_CHECK_CFGS {
14691469 if * restricted_mode == None || * restricted_mode == Some ( mode) {
1470- // Creating a string of the values by concatenating each value:
1471- // ',values("tvos","watchos")' or '' (nothing) when there are no values.
1472- let next = match values {
1473- Some ( values) => {
1474- let mut tmp = values
1475- . iter ( )
1476- . map ( |val| [ "," , "\" " , val, "\" " ] )
1477- . flatten ( )
1478- . collect :: < String > ( ) ;
1479-
1480- tmp. insert_str ( 1 , "values(" ) ;
1481- tmp. push_str ( ")" ) ;
1482- tmp
1483- }
1484- None => "" . to_string ( ) ,
1485- } ;
1486- rustflags. arg ( & format ! ( "--check-cfg=cfg({name}{next})" ) ) ;
1470+ rustflags. arg ( & check_cfg_arg ( name, * values) ) ;
14871471 }
14881472 }
14891473
0 commit comments