Skip to content

Commit

Permalink
Require a thread-safe file loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Mar 14, 2018
1 parent e96e54d commit 26fe97f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/librustc_driver/lib.rs
Expand Up @@ -444,7 +444,7 @@ fn get_trans_sysroot(backend_name: &str) -> fn() -> Box<TransCrate> {
// The FileLoader provides a way to load files from sources other than the file system.
pub fn run_compiler<'a>(args: &[String],
callbacks: &mut CompilerCalls<'a>,
file_loader: Option<Box<FileLoader + 'static>>,
file_loader: Option<Box<FileLoader + Send + Sync + 'static>>,
emitter_dest: Option<Box<Write + Send>>)
-> (CompileResult, Option<Session>)
{
Expand All @@ -455,7 +455,7 @@ pub fn run_compiler<'a>(args: &[String],

fn run_compiler_impl<'a>(args: &[String],
callbacks: &mut CompilerCalls<'a>,
file_loader: Option<Box<FileLoader + 'static>>,
file_loader: Option<Box<FileLoader + Send + Sync + 'static>>,
emitter_dest: Option<Box<Write + Send>>)
-> (CompileResult, Option<Session>)
{
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax/codemap.rs
Expand Up @@ -127,7 +127,7 @@ impl StableFilemapId {

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

}

pub fn with_file_loader(file_loader: Box<FileLoader>,
pub fn with_file_loader(file_loader: Box<FileLoader + Sync + Send>,
path_mapping: FilePathMapping)
-> CodeMap {
CodeMap {
Expand Down

0 comments on commit 26fe97f

Please sign in to comment.