Skip to content

Commit 26fe97f

Browse files
committed
Require a thread-safe file loader
1 parent e96e54d commit 26fe97f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc_driver/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ fn get_trans_sysroot(backend_name: &str) -> fn() -> Box<TransCrate> {
444444
// The FileLoader provides a way to load files from sources other than the file system.
445445
pub fn run_compiler<'a>(args: &[String],
446446
callbacks: &mut CompilerCalls<'a>,
447-
file_loader: Option<Box<FileLoader + 'static>>,
447+
file_loader: Option<Box<FileLoader + Send + Sync + 'static>>,
448448
emitter_dest: Option<Box<Write + Send>>)
449449
-> (CompileResult, Option<Session>)
450450
{
@@ -455,7 +455,7 @@ pub fn run_compiler<'a>(args: &[String],
455455

456456
fn run_compiler_impl<'a>(args: &[String],
457457
callbacks: &mut CompilerCalls<'a>,
458-
file_loader: Option<Box<FileLoader + 'static>>,
458+
file_loader: Option<Box<FileLoader + Send + Sync + 'static>>,
459459
emitter_dest: Option<Box<Write + Send>>)
460460
-> (CompileResult, Option<Session>)
461461
{

src/libsyntax/codemap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl StableFilemapId {
127127

128128
pub struct CodeMap {
129129
pub(super) files: RefCell<Vec<Lrc<FileMap>>>,
130-
file_loader: Box<FileLoader>,
130+
file_loader: Box<FileLoader + Sync + Send>,
131131
// This is used to apply the file path remapping as specified via
132132
// --remap-path-prefix to all FileMaps allocated within this CodeMap.
133133
path_mapping: FilePathMapping,
@@ -157,7 +157,7 @@ impl CodeMap {
157157

158158
}
159159

160-
pub fn with_file_loader(file_loader: Box<FileLoader>,
160+
pub fn with_file_loader(file_loader: Box<FileLoader + Sync + Send>,
161161
path_mapping: FilePathMapping)
162162
-> CodeMap {
163163
CodeMap {

0 commit comments

Comments
 (0)