@@ -13,6 +13,8 @@ use rustc::session::early_error;
13
13
use rustc_driver:: Compilation ;
14
14
use rustc_driver:: { run_compiler, Callbacks } ;
15
15
use rustc_interface:: interface;
16
+ #[ cfg( feature = "ipc" ) ]
17
+ use rustc_interface:: Queries ;
16
18
17
19
use std:: env;
18
20
#[ allow( unused_imports) ]
@@ -101,7 +103,11 @@ impl Callbacks for ShimCalls {
101
103
}
102
104
103
105
#[ cfg( feature = "ipc" ) ]
104
- fn after_expansion ( & mut self , compiler : & interface:: Compiler ) -> Compilation {
106
+ fn after_expansion < ' tcx > (
107
+ & mut self ,
108
+ compiler : & interface:: Compiler ,
109
+ queries : & ' tcx Queries < ' tcx > ,
110
+ ) -> Compilation {
105
111
use rustc:: session:: config:: Input ;
106
112
107
113
use futures:: future:: Future ;
@@ -115,7 +121,7 @@ impl Callbacks for ShimCalls {
115
121
116
122
let sess = compiler. session ( ) ;
117
123
let input = compiler. input ( ) ;
118
- let crate_name = compiler . crate_name ( ) . unwrap ( ) . peek ( ) . clone ( ) ;
124
+ let crate_name = queries . crate_name ( ) . unwrap ( ) . peek ( ) . clone ( ) ;
119
125
120
126
let cwd = & sess. working_dir . 0 ;
121
127
@@ -148,7 +154,11 @@ impl Callbacks for ShimCalls {
148
154
}
149
155
150
156
#[ cfg( feature = "ipc" ) ]
151
- fn after_analysis ( & mut self , compiler : & interface:: Compiler ) -> Compilation {
157
+ fn after_analysis < ' tcx > (
158
+ & mut self ,
159
+ compiler : & interface:: Compiler ,
160
+ queries : & ' tcx Queries < ' tcx > ,
161
+ ) -> Compilation {
152
162
use futures:: future:: Future ;
153
163
154
164
let callbacks = match self . callbacks . as_ref ( ) {
@@ -159,12 +169,12 @@ impl Callbacks for ShimCalls {
159
169
use rustc_save_analysis:: CallbackHandler ;
160
170
161
171
let input = compiler. input ( ) ;
162
- let crate_name = compiler . crate_name ( ) . unwrap ( ) . peek ( ) . clone ( ) ;
172
+ let crate_name = queries . crate_name ( ) . unwrap ( ) . peek ( ) . clone ( ) ;
163
173
164
174
// Guaranteed to not be dropped yet in the pipeline thanks to the
165
175
// `config.opts.debugging_opts.save_analysis` value being set to `true`.
166
- let expanded_crate = & compiler . expansion ( ) . unwrap ( ) . peek ( ) . 0 ;
167
- compiler . global_ctxt ( ) . unwrap ( ) . peek_mut ( ) . enter ( |tcx| {
176
+ let expanded_crate = & queries . expansion ( ) . unwrap ( ) . peek ( ) . 0 ;
177
+ queries . global_ctxt ( ) . unwrap ( ) . peek_mut ( ) . enter ( |tcx| {
168
178
// There are two ways to move the data from rustc to the RLS, either
169
179
// directly or by serialising and deserialising. We only want to do
170
180
// the latter when there are compatibility issues between crates.
0 commit comments