@@ -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
@@ -99,17 +99,29 @@ pub trait Callbacks {
99
99
fn config ( & mut self , _config : & mut interface:: Config ) { }
100
100
/// Called after parsing. Return value instructs the compiler whether to
101
101
/// continue the compilation afterwards (defaults to `Compilation::Continue`)
102
- fn after_parsing ( & mut self , _compiler : & interface:: Compiler ) -> Compilation {
102
+ fn after_parsing < ' tcx > (
103
+ & mut self ,
104
+ _compiler : & interface:: Compiler ,
105
+ _queries : & ' tcx Queries < ' tcx > ,
106
+ ) -> Compilation {
103
107
Compilation :: Continue
104
108
}
105
109
/// Called after expansion. Return value instructs the compiler whether to
106
110
/// continue the compilation afterwards (defaults to `Compilation::Continue`)
107
- fn after_expansion ( & mut self , _compiler : & interface:: Compiler ) -> Compilation {
111
+ fn after_expansion < ' tcx > (
112
+ & mut self ,
113
+ _compiler : & interface:: Compiler ,
114
+ _queries : & ' tcx Queries < ' tcx > ,
115
+ ) -> Compilation {
108
116
Compilation :: Continue
109
117
}
110
118
/// Called after analysis. Return value instructs the compiler whether to
111
119
/// continue the compilation afterwards (defaults to `Compilation::Continue`)
112
- fn after_analysis ( & mut self , _compiler : & interface:: Compiler ) -> Compilation {
120
+ fn after_analysis < ' tcx > (
121
+ & mut self ,
122
+ _compiler : & interface:: Compiler ,
123
+ _queries : & ' tcx Queries < ' tcx > ,
124
+ ) -> Compilation {
113
125
Compilation :: Continue
114
126
}
115
127
}
@@ -313,7 +325,7 @@ pub fn run_compiler(
313
325
return early_exit ( ) ;
314
326
}
315
327
316
- if callbacks. after_parsing ( compiler) == Compilation :: Stop {
328
+ if callbacks. after_parsing ( compiler, queries ) == Compilation :: Stop {
317
329
return early_exit ( ) ;
318
330
}
319
331
@@ -334,7 +346,7 @@ pub fn run_compiler(
334
346
}
335
347
336
348
queries. expansion ( ) ?;
337
- if callbacks. after_expansion ( compiler) == Compilation :: Stop {
349
+ if callbacks. after_expansion ( compiler, queries ) == Compilation :: Stop {
338
350
return early_exit ( ) ;
339
351
}
340
352
@@ -383,7 +395,7 @@ pub fn run_compiler(
383
395
384
396
queries. global_ctxt ( ) ?. peek_mut ( ) . enter ( |tcx| tcx. analysis ( LOCAL_CRATE ) ) ?;
385
397
386
- if callbacks. after_analysis ( compiler) == Compilation :: Stop {
398
+ if callbacks. after_analysis ( compiler, queries ) == Compilation :: Stop {
387
399
return early_exit ( ) ;
388
400
}
389
401
0 commit comments