@@ -23,7 +23,6 @@ use symbol::Symbol;
2323use tokenstream:: { TokenStream , TokenTree } ;
2424use diagnostics:: plugin:: ErrorMap ;
2525
26- use std:: cell:: RefCell ;
2726use std:: collections:: HashSet ;
2827use std:: iter;
2928use std:: path:: { Path , PathBuf } ;
@@ -47,17 +46,17 @@ pub struct ParseSess {
4746 pub span_diagnostic : Handler ,
4847 pub unstable_features : UnstableFeatures ,
4948 pub config : CrateConfig ,
50- pub missing_fragment_specifiers : RefCell < HashSet < Span > > ,
49+ pub missing_fragment_specifiers : Lock < HashSet < Span > > ,
5150 /// Places where raw identifiers were used. This is used for feature gating
5251 /// raw identifiers
53- pub raw_identifier_spans : RefCell < Vec < Span > > ,
52+ pub raw_identifier_spans : Lock < Vec < Span > > ,
5453 /// The registered diagnostics codes
5554 pub registered_diagnostics : Lock < ErrorMap > ,
5655 // Spans where a `mod foo;` statement was included in a non-mod.rs file.
5756 // These are used to issue errors if the non_modrs_mods feature is not enabled.
58- pub non_modrs_mods : RefCell < Vec < ( ast:: Ident , Span ) > > ,
57+ pub non_modrs_mods : Lock < Vec < ( ast:: Ident , Span ) > > ,
5958 /// Used to determine and report recursive mod inclusions
60- included_mod_stack : RefCell < Vec < PathBuf > > ,
59+ included_mod_stack : Lock < Vec < PathBuf > > ,
6160 code_map : Lrc < CodeMap > ,
6261}
6362
@@ -76,12 +75,12 @@ impl ParseSess {
7675 span_diagnostic : handler,
7776 unstable_features : UnstableFeatures :: from_environment ( ) ,
7877 config : HashSet :: new ( ) ,
79- missing_fragment_specifiers : RefCell :: new ( HashSet :: new ( ) ) ,
80- raw_identifier_spans : RefCell :: new ( Vec :: new ( ) ) ,
78+ missing_fragment_specifiers : Lock :: new ( HashSet :: new ( ) ) ,
79+ raw_identifier_spans : Lock :: new ( Vec :: new ( ) ) ,
8180 registered_diagnostics : Lock :: new ( ErrorMap :: new ( ) ) ,
82- included_mod_stack : RefCell :: new ( vec ! [ ] ) ,
81+ included_mod_stack : Lock :: new ( vec ! [ ] ) ,
8382 code_map,
84- non_modrs_mods : RefCell :: new ( vec ! [ ] ) ,
83+ non_modrs_mods : Lock :: new ( vec ! [ ] ) ,
8584 }
8685 }
8786
0 commit comments