@@ -1853,7 +1853,7 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
1853
1853
1854
1854
// Convert strings provided as --cfg [cfgspec] into a crate_cfg
1855
1855
pub fn parse_cfgspecs ( cfgspecs : Vec < String > ) -> FxHashSet < ( String , Option < String > ) > {
1856
- syntax:: with_globals ( move || {
1856
+ syntax:: with_default_globals ( move || {
1857
1857
let cfg = cfgspecs. into_iter ( ) . map ( |s| {
1858
1858
let sess = parse:: ParseSess :: new ( FilePathMapping :: empty ( ) ) ;
1859
1859
let filename = FileName :: cfg_spec_source_code ( & s) ;
@@ -2735,7 +2735,7 @@ mod tests {
2735
2735
// When the user supplies --test we should implicitly supply --cfg test
2736
2736
#[ test]
2737
2737
fn test_switch_implies_cfg_test ( ) {
2738
- syntax:: with_globals ( || {
2738
+ syntax:: with_default_globals ( || {
2739
2739
let matches = & match optgroups ( ) . parse ( & [ "--test" . to_string ( ) ] ) {
2740
2740
Ok ( m) => m,
2741
2741
Err ( f) => panic ! ( "test_switch_implies_cfg_test: {}" , f) ,
@@ -2753,7 +2753,7 @@ mod tests {
2753
2753
#[ test]
2754
2754
fn test_switch_implies_cfg_test_unless_cfg_test ( ) {
2755
2755
use syntax:: symbol:: sym;
2756
- syntax:: with_globals ( || {
2756
+ syntax:: with_default_globals ( || {
2757
2757
let matches = & match optgroups ( ) . parse ( & [ "--test" . to_string ( ) ,
2758
2758
"--cfg=test" . to_string ( ) ] ) {
2759
2759
Ok ( m) => m,
@@ -2771,15 +2771,15 @@ mod tests {
2771
2771
2772
2772
#[ test]
2773
2773
fn test_can_print_warnings ( ) {
2774
- syntax:: with_globals ( || {
2774
+ syntax:: with_default_globals ( || {
2775
2775
let matches = optgroups ( ) . parse ( & [ "-Awarnings" . to_string ( ) ] ) . unwrap ( ) ;
2776
2776
let registry = errors:: registry:: Registry :: new ( & [ ] ) ;
2777
2777
let ( sessopts, _) = build_session_options_and_crate_config ( & matches) ;
2778
2778
let sess = build_session ( sessopts, None , registry) ;
2779
2779
assert ! ( !sess. diagnostic( ) . flags. can_emit_warnings) ;
2780
2780
} ) ;
2781
2781
2782
- syntax:: with_globals ( || {
2782
+ syntax:: with_default_globals ( || {
2783
2783
let matches = optgroups ( )
2784
2784
. parse ( & [ "-Awarnings" . to_string ( ) , "-Dwarnings" . to_string ( ) ] )
2785
2785
. unwrap ( ) ;
@@ -2789,7 +2789,7 @@ mod tests {
2789
2789
assert ! ( sess. diagnostic( ) . flags. can_emit_warnings) ;
2790
2790
} ) ;
2791
2791
2792
- syntax:: with_globals ( || {
2792
+ syntax:: with_default_globals ( || {
2793
2793
let matches = optgroups ( ) . parse ( & [ "-Adead_code" . to_string ( ) ] ) . unwrap ( ) ;
2794
2794
let registry = errors:: registry:: Registry :: new ( & [ ] ) ;
2795
2795
let ( sessopts, _) = build_session_options_and_crate_config ( & matches) ;
0 commit comments