Skip to content

Commit 16ba778

Browse files
committed
Support parallel compiler.
1 parent 448c255 commit 16ba778

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

compiler/rustc_metadata/src/rmeta/decoder.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use rustc_span::symbol::{sym, Ident, Symbol};
3737
use rustc_span::{self, BytePos, ExpnId, Pos, Span, SyntaxContext, DUMMY_SP};
3838

3939
use proc_macro::bridge::client::ProcMacro;
40-
use std::cell::RefCell;
4140
use std::io;
4241
use std::iter::TrustedLen;
4342
use 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

Comments
 (0)