diff --git a/rls-rustc/src/lib.rs b/rls-rustc/src/lib.rs index a06d4efcf36..c90ed564759 100644 --- a/rls-rustc/src/lib.rs +++ b/rls-rustc/src/lib.rs @@ -98,14 +98,12 @@ impl Callbacks for ShimCalls { Compilation::Continue } - fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation { + fn after_expansion(&mut self, compiler: &interface::Compiler) -> Compilation { let callbacks = match self.callbacks.as_ref() { Some(callbacks) => callbacks, None => return Compilation::Continue, }; - use rustc_save_analysis::CallbackHandler; - let sess = compiler.session(); let input = compiler.input(); let crate_name = compiler.crate_name().unwrap().peek().clone(); @@ -138,6 +136,20 @@ impl Callbacks for ShimCalls { eprintln!("Can't send input files as part of a compilation callback: {:?}", e); } + Compilation::Continue + } + + fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation { + let callbacks = match self.callbacks.as_ref() { + Some(callbacks) => callbacks, + None => return Compilation::Continue, + }; + + use rustc_save_analysis::CallbackHandler; + + let input = compiler.input(); + let crate_name = compiler.crate_name().unwrap().peek().clone(); + // Guaranteed to not be dropped yet in the pipeline thanks to the // `config.opts.debugging_opts.save_analysis` value being set to `true`. let expanded_crate = &compiler.expansion().unwrap().peek().0;