@@ -37,7 +37,6 @@ use rustc_span::symbol::{sym, Ident, Symbol};
3737use rustc_span:: { self , BytePos , ExpnId , Pos , Span , SyntaxContext , DUMMY_SP } ;
3838
3939use proc_macro:: bridge:: client:: ProcMacro ;
40- use std:: cell:: RefCell ;
4140use std:: io;
4241use std:: iter:: TrustedLen ;
4342use std:: mem;
@@ -100,7 +99,7 @@ pub(crate) struct CrateMetadata {
10099 /// Proc macro descriptions for this crate, if it's a proc macro crate.
101100 raw_proc_macros : Option < & ' static [ ProcMacro ] > ,
102101 /// Source maps for code from the crate.
103- source_map_import_info : RefCell < Vec < Option < ImportedSourceFile > > > ,
102+ source_map_import_info : Lock < Vec < Option < ImportedSourceFile > > > ,
104103 /// For every definition in this crate, maps its `DefPathHash` to its `DefIndex`.
105104 def_path_hash_map : DefPathHashMapRef < ' static > ,
106105 /// Likewise for ExpnHash.
@@ -1514,7 +1513,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
15141513 }
15151514 } ;
15161515
1517- let mut import_info = self . cdata . source_map_import_info . borrow_mut ( ) ;
1516+ let mut import_info = self . cdata . source_map_import_info . lock ( ) ;
15181517 for _ in import_info. len ( ) ..=( source_file_index as usize ) {
15191518 import_info. push ( None ) ;
15201519 }
@@ -1667,7 +1666,7 @@ impl CrateMetadata {
16671666 trait_impls,
16681667 incoherent_impls : Default :: default ( ) ,
16691668 raw_proc_macros,
1670- source_map_import_info : RefCell :: new ( Vec :: new ( ) ) ,
1669+ source_map_import_info : Lock :: new ( Vec :: new ( ) ) ,
16711670 def_path_hash_map,
16721671 expn_hash_map : Default :: default ( ) ,
16731672 alloc_decoding_state,
0 commit comments