@@ -1853,7 +1853,7 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
18531853
18541854// Convert strings provided as --cfg [cfgspec] into a crate_cfg
18551855pub fn parse_cfgspecs ( cfgspecs : Vec < String > ) -> FxHashSet < ( String , Option < String > ) > {
1856- syntax:: with_globals ( move || {
1856+ syntax:: with_default_globals ( move || {
18571857 let cfg = cfgspecs. into_iter ( ) . map ( |s| {
18581858 let sess = parse:: ParseSess :: new ( FilePathMapping :: empty ( ) ) ;
18591859 let filename = FileName :: cfg_spec_source_code ( & s) ;
@@ -2735,7 +2735,7 @@ mod tests {
27352735 // When the user supplies --test we should implicitly supply --cfg test
27362736 #[ test]
27372737 fn test_switch_implies_cfg_test ( ) {
2738- syntax:: with_globals ( || {
2738+ syntax:: with_default_globals ( || {
27392739 let matches = & match optgroups ( ) . parse ( & [ "--test" . to_string ( ) ] ) {
27402740 Ok ( m) => m,
27412741 Err ( f) => panic ! ( "test_switch_implies_cfg_test: {}" , f) ,
@@ -2753,7 +2753,7 @@ mod tests {
27532753 #[ test]
27542754 fn test_switch_implies_cfg_test_unless_cfg_test ( ) {
27552755 use syntax:: symbol:: sym;
2756- syntax:: with_globals ( || {
2756+ syntax:: with_default_globals ( || {
27572757 let matches = & match optgroups ( ) . parse ( & [ "--test" . to_string ( ) ,
27582758 "--cfg=test" . to_string ( ) ] ) {
27592759 Ok ( m) => m,
@@ -2771,15 +2771,15 @@ mod tests {
27712771
27722772 #[ test]
27732773 fn test_can_print_warnings ( ) {
2774- syntax:: with_globals ( || {
2774+ syntax:: with_default_globals ( || {
27752775 let matches = optgroups ( ) . parse ( & [ "-Awarnings" . to_string ( ) ] ) . unwrap ( ) ;
27762776 let registry = errors:: registry:: Registry :: new ( & [ ] ) ;
27772777 let ( sessopts, _) = build_session_options_and_crate_config ( & matches) ;
27782778 let sess = build_session ( sessopts, None , registry) ;
27792779 assert ! ( !sess. diagnostic( ) . flags. can_emit_warnings) ;
27802780 } ) ;
27812781
2782- syntax:: with_globals ( || {
2782+ syntax:: with_default_globals ( || {
27832783 let matches = optgroups ( )
27842784 . parse ( & [ "-Awarnings" . to_string ( ) , "-Dwarnings" . to_string ( ) ] )
27852785 . unwrap ( ) ;
@@ -2789,7 +2789,7 @@ mod tests {
27892789 assert ! ( sess. diagnostic( ) . flags. can_emit_warnings) ;
27902790 } ) ;
27912791
2792- syntax:: with_globals ( || {
2792+ syntax:: with_default_globals ( || {
27932793 let matches = optgroups ( ) . parse ( & [ "-Adead_code" . to_string ( ) ] ) . unwrap ( ) ;
27942794 let registry = errors:: registry:: Registry :: new ( & [ ] ) ;
27952795 let ( sessopts, _) = build_session_options_and_crate_config ( & matches) ;
0 commit comments