@@ -99,7 +99,7 @@ pub struct Session {
99
99
/// forms a unique global identifier for the crate. It is used to allow
100
100
/// multiple crates with the same name to coexist. See the
101
101
/// trans::back::symbol_names module for more information.
102
- pub crate_disambiguator : RefCell < Option < CrateDisambiguator > > ,
102
+ pub crate_disambiguator : Once < CrateDisambiguator > ,
103
103
104
104
features : Once < feature_gate:: Features > ,
105
105
@@ -202,10 +202,7 @@ impl From<&'static lint::Lint> for DiagnosticMessageId {
202
202
203
203
impl Session {
204
204
pub fn local_crate_disambiguator ( & self ) -> CrateDisambiguator {
205
- match * self . crate_disambiguator . borrow ( ) {
206
- Some ( value) => value,
207
- None => bug ! ( "accessing disambiguator before initialization" ) ,
208
- }
205
+ * self . crate_disambiguator . get ( )
209
206
}
210
207
211
208
pub fn struct_span_warn < ' a , S : Into < MultiSpan > > (
@@ -1101,7 +1098,7 @@ pub fn build_session_(
1101
1098
plugin_attributes : RefCell :: new ( Vec :: new ( ) ) ,
1102
1099
crate_types : RefCell :: new ( Vec :: new ( ) ) ,
1103
1100
dependency_formats : RefCell :: new ( FxHashMap ( ) ) ,
1104
- crate_disambiguator : RefCell :: new ( None ) ,
1101
+ crate_disambiguator : Once :: new ( ) ,
1105
1102
features : Once :: new ( ) ,
1106
1103
recursion_limit : Once :: new ( ) ,
1107
1104
type_length_limit : Once :: new ( ) ,
0 commit comments