Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 1f686d5

Browse files
committed
Replace removed run_compiler function
1 parent 95d0d9f commit 1f686d5

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

rls-rustc/src/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extern crate rustc_span;
99

1010
#[cfg(feature = "ipc")]
1111
use rustc_driver::Compilation;
12-
use rustc_driver::{run_compiler, Callbacks};
12+
use rustc_driver::{Callbacks, RunCompiler};
1313
use rustc_interface::interface;
1414
#[cfg(feature = "ipc")]
1515
use rustc_interface::Queries;
@@ -75,8 +75,10 @@ pub fn run() -> Result<(), ()> {
7575
};
7676

7777
rustc_driver::install_ice_hook();
78-
rustc_driver::catch_fatal_errors(|| {
79-
run_compiler(&args, &mut shim_calls, file_loader, None, None)
78+
rustc_driver::catch_fatal_errors(move || {
79+
let mut compiler = RunCompiler::new(&args, &mut shim_calls);
80+
compiler.set_file_loader(file_loader);
81+
compiler.run()
8082
})
8183
.map(|_| ())
8284
.map_err(|_| ())

rls/src/build/rustc.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use log::trace;
1919
use rls_data::Analysis;
2020
use rls_vfs::Vfs;
2121

22-
use self::rustc_driver::{run_compiler, Compilation};
22+
use self::rustc_driver::{Compilation, RunCompiler};
2323
use self::rustc_interface::interface;
2424
use self::rustc_interface::Queries;
2525
use self::rustc_save_analysis as save;
@@ -185,14 +185,12 @@ fn run_in_process(
185185
let stderr = Arc::clone(&stderr);
186186
|| {
187187
rustc_driver::catch_fatal_errors(move || {
188-
// Replace stderr so we catch most errors.
189-
run_compiler(
190-
&args,
191-
&mut callbacks,
192-
Some(Box::new(ReplacedFileLoader::new(changed))),
193-
Some(Box::new(BufWriter(stderr))),
194-
None,
195-
)
188+
let mut compiler = RunCompiler::new(&args, &mut callbacks);
189+
compiler
190+
.set_file_loader(Some(Box::new(ReplacedFileLoader::new(changed))))
191+
// Replace stderr so we catch most errors.
192+
.set_emitter(Some(Box::new(BufWriter(stderr))));
193+
compiler.run()
196194
})
197195
}
198196
})

0 commit comments

Comments
 (0)