Skip to content

Commit 0a93c3d

Browse files
committed
Collect files -> editions mapping after expansion when out-of-process
Applies the equivalent of rust-lang#1513 in the out-of-process compilation case
1 parent 6b594e0 commit 0a93c3d

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

rls-rustc/src/lib.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,12 @@ impl Callbacks for ShimCalls {
9898
Compilation::Continue
9999
}
100100

101-
fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
101+
fn after_expansion(&mut self, compiler: &interface::Compiler) -> Compilation {
102102
let callbacks = match self.callbacks.as_ref() {
103103
Some(callbacks) => callbacks,
104104
None => return Compilation::Continue,
105105
};
106106

107-
use rustc_save_analysis::CallbackHandler;
108-
109107
let sess = compiler.session();
110108
let input = compiler.input();
111109
let crate_name = compiler.crate_name().unwrap().peek().clone();
@@ -138,6 +136,20 @@ impl Callbacks for ShimCalls {
138136
eprintln!("Can't send input files as part of a compilation callback: {:?}", e);
139137
}
140138

139+
Compilation::Continue
140+
}
141+
142+
fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
143+
let callbacks = match self.callbacks.as_ref() {
144+
Some(callbacks) => callbacks,
145+
None => return Compilation::Continue,
146+
};
147+
148+
use rustc_save_analysis::CallbackHandler;
149+
150+
let input = compiler.input();
151+
let crate_name = compiler.crate_name().unwrap().peek().clone();
152+
141153
// Guaranteed to not be dropped yet in the pipeline thanks to the
142154
// `config.opts.debugging_opts.save_analysis` value being set to `true`.
143155
let expanded_crate = &compiler.expansion().unwrap().peek().0;

0 commit comments

Comments
 (0)