@@ -37,7 +37,6 @@ use rustc_span::symbol::{sym, Ident, Symbol};
37
37
use rustc_span:: { self , BytePos , ExpnId , Pos , Span , SyntaxContext , DUMMY_SP } ;
38
38
39
39
use proc_macro:: bridge:: client:: ProcMacro ;
40
- use std:: cell:: RefCell ;
41
40
use std:: io;
42
41
use std:: iter:: TrustedLen ;
43
42
use std:: mem;
@@ -100,7 +99,7 @@ pub(crate) struct CrateMetadata {
100
99
/// Proc macro descriptions for this crate, if it's a proc macro crate.
101
100
raw_proc_macros : Option < & ' static [ ProcMacro ] > ,
102
101
/// 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 > > > ,
104
103
/// For every definition in this crate, maps its `DefPathHash` to its `DefIndex`.
105
104
def_path_hash_map : DefPathHashMapRef < ' static > ,
106
105
/// Likewise for ExpnHash.
@@ -1514,7 +1513,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1514
1513
}
1515
1514
} ;
1516
1515
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 ( ) ;
1518
1517
for _ in import_info. len ( ) ..=( source_file_index as usize ) {
1519
1518
import_info. push ( None ) ;
1520
1519
}
@@ -1667,7 +1666,7 @@ impl CrateMetadata {
1667
1666
trait_impls,
1668
1667
incoherent_impls : Default :: default ( ) ,
1669
1668
raw_proc_macros,
1670
- source_map_import_info : RefCell :: new ( Vec :: new ( ) ) ,
1669
+ source_map_import_info : Lock :: new ( Vec :: new ( ) ) ,
1671
1670
def_path_hash_map,
1672
1671
expn_hash_map : Default :: default ( ) ,
1673
1672
alloc_decoding_state,
0 commit comments