@@ -23,7 +23,6 @@ use symbol::Symbol;
23
23
use tokenstream:: { TokenStream , TokenTree } ;
24
24
use diagnostics:: plugin:: ErrorMap ;
25
25
26
- use std:: cell:: RefCell ;
27
26
use std:: collections:: HashSet ;
28
27
use std:: iter;
29
28
use std:: path:: { Path , PathBuf } ;
@@ -47,17 +46,17 @@ pub struct ParseSess {
47
46
pub span_diagnostic : Handler ,
48
47
pub unstable_features : UnstableFeatures ,
49
48
pub config : CrateConfig ,
50
- pub missing_fragment_specifiers : RefCell < HashSet < Span > > ,
49
+ pub missing_fragment_specifiers : Lock < HashSet < Span > > ,
51
50
/// Places where raw identifiers were used. This is used for feature gating
52
51
/// raw identifiers
53
- pub raw_identifier_spans : RefCell < Vec < Span > > ,
52
+ pub raw_identifier_spans : Lock < Vec < Span > > ,
54
53
/// The registered diagnostics codes
55
54
pub registered_diagnostics : Lock < ErrorMap > ,
56
55
// Spans where a `mod foo;` statement was included in a non-mod.rs file.
57
56
// 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 ) > > ,
59
58
/// Used to determine and report recursive mod inclusions
60
- included_mod_stack : RefCell < Vec < PathBuf > > ,
59
+ included_mod_stack : Lock < Vec < PathBuf > > ,
61
60
code_map : Lrc < CodeMap > ,
62
61
}
63
62
@@ -76,12 +75,12 @@ impl ParseSess {
76
75
span_diagnostic : handler,
77
76
unstable_features : UnstableFeatures :: from_environment ( ) ,
78
77
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 ( ) ) ,
81
80
registered_diagnostics : Lock :: new ( ErrorMap :: new ( ) ) ,
82
- included_mod_stack : RefCell :: new ( vec ! [ ] ) ,
81
+ included_mod_stack : Lock :: new ( vec ! [ ] ) ,
83
82
code_map,
84
- non_modrs_mods : RefCell :: new ( vec ! [ ] ) ,
83
+ non_modrs_mods : Lock :: new ( vec ! [ ] ) ,
85
84
}
86
85
}
87
86
0 commit comments