mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
Require a thread-safe file loader
This commit is contained in:
@@ -444,7 +444,7 @@ fn GetModuleFileNameW(hModule: usize,
|
||||
// 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>)
|
||||
{
|
||||
@@ -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>)
|
||||
{
|
||||
|
||||
@@ -127,7 +127,7 @@ pub fn new(filemap: &FileMap) -> 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,
|
||||
@@ -157,7 +157,7 @@ pub fn new_doctest(path_mapping: FilePathMapping,
|
||||
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user