@@ -41,7 +41,7 @@ use rustc::util::common::{set_time_depth, time, print_time_passes_entry, ErrorRe
41
41
use rustc_metadata:: locator;
42
42
use rustc_codegen_utils:: codegen_backend:: CodegenBackend ;
43
43
use errors:: { PResult , registry:: Registry } ;
44
- use rustc_interface:: interface;
44
+ use rustc_interface:: { interface, Queries } ;
45
45
use rustc_interface:: util:: get_codegen_sysroot;
46
46
use rustc_data_structures:: sync:: SeqCst ;
47
47
use rustc_feature:: { find_gated_cfg, UnstableFeatures } ;
@@ -98,17 +98,29 @@ pub trait Callbacks {
98
98
fn config ( & mut self , _config : & mut interface:: Config ) { }
99
99
/// Called after parsing. Return value instructs the compiler whether to
100
100
/// continue the compilation afterwards (defaults to `Compilation::Continue`)
101
- fn after_parsing ( & mut self , _compiler : & interface:: Compiler ) -> Compilation {
101
+ fn after_parsing < ' tcx > (
102
+ & mut self ,
103
+ _compiler : & interface:: Compiler ,
104
+ _queries : & ' tcx Queries < ' tcx > ,
105
+ ) -> Compilation {
102
106
Compilation :: Continue
103
107
}
104
108
/// Called after expansion. Return value instructs the compiler whether to
105
109
/// continue the compilation afterwards (defaults to `Compilation::Continue`)
106
- fn after_expansion ( & mut self , _compiler : & interface:: Compiler ) -> Compilation {
110
+ fn after_expansion < ' tcx > (
111
+ & mut self ,
112
+ _compiler : & interface:: Compiler ,
113
+ _queries : & ' tcx Queries < ' tcx > ,
114
+ ) -> Compilation {
107
115
Compilation :: Continue
108
116
}
109
117
/// Called after analysis. Return value instructs the compiler whether to
110
118
/// continue the compilation afterwards (defaults to `Compilation::Continue`)
111
- fn after_analysis ( & mut self , _compiler : & interface:: Compiler ) -> Compilation {
119
+ fn after_analysis < ' tcx > (
120
+ & mut self ,
121
+ _compiler : & interface:: Compiler ,
122
+ _queries : & ' tcx Queries < ' tcx > ,
123
+ ) -> Compilation {
112
124
Compilation :: Continue
113
125
}
114
126
}
@@ -312,7 +324,7 @@ pub fn run_compiler(
312
324
return early_exit ( ) ;
313
325
}
314
326
315
- if callbacks. after_parsing ( compiler) == Compilation :: Stop {
327
+ if callbacks. after_parsing ( compiler, queries ) == Compilation :: Stop {
316
328
return early_exit ( ) ;
317
329
}
318
330
@@ -333,7 +345,7 @@ pub fn run_compiler(
333
345
}
334
346
335
347
queries. expansion ( ) ?;
336
- if callbacks. after_expansion ( compiler) == Compilation :: Stop {
348
+ if callbacks. after_expansion ( compiler, queries ) == Compilation :: Stop {
337
349
return early_exit ( ) ;
338
350
}
339
351
@@ -382,7 +394,7 @@ pub fn run_compiler(
382
394
383
395
queries. global_ctxt ( ) ?. peek_mut ( ) . enter ( |tcx| tcx. analysis ( LOCAL_CRATE ) ) ?;
384
396
385
- if callbacks. after_analysis ( compiler) == Compilation :: Stop {
397
+ if callbacks. after_analysis ( compiler, queries ) == Compilation :: Stop {
386
398
return early_exit ( ) ;
387
399
}
388
400
0 commit comments