@@ -41,7 +41,7 @@ use rustc::util::common::{set_time_depth, time, print_time_passes_entry, ErrorRe
4141use rustc_metadata:: locator;
4242use rustc_codegen_utils:: codegen_backend:: CodegenBackend ;
4343use errors:: { PResult , registry:: Registry } ;
44- use rustc_interface:: interface;
44+ use rustc_interface:: { interface, Queries } ;
4545use rustc_interface:: util:: get_codegen_sysroot;
4646use rustc_data_structures:: sync:: SeqCst ;
4747use rustc_feature:: { find_gated_cfg, UnstableFeatures } ;
@@ -98,17 +98,29 @@ pub trait Callbacks {
9898 fn config ( & mut self , _config : & mut interface:: Config ) { }
9999 /// Called after parsing. Return value instructs the compiler whether to
100100 /// 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 {
102106 Compilation :: Continue
103107 }
104108 /// Called after expansion. Return value instructs the compiler whether to
105109 /// 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 {
107115 Compilation :: Continue
108116 }
109117 /// Called after analysis. Return value instructs the compiler whether to
110118 /// 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 {
112124 Compilation :: Continue
113125 }
114126}
@@ -312,7 +324,7 @@ pub fn run_compiler(
312324 return early_exit ( ) ;
313325 }
314326
315- if callbacks. after_parsing ( compiler) == Compilation :: Stop {
327+ if callbacks. after_parsing ( compiler, queries ) == Compilation :: Stop {
316328 return early_exit ( ) ;
317329 }
318330
@@ -333,7 +345,7 @@ pub fn run_compiler(
333345 }
334346
335347 queries. expansion ( ) ?;
336- if callbacks. after_expansion ( compiler) == Compilation :: Stop {
348+ if callbacks. after_expansion ( compiler, queries ) == Compilation :: Stop {
337349 return early_exit ( ) ;
338350 }
339351
@@ -382,7 +394,7 @@ pub fn run_compiler(
382394
383395 queries. global_ctxt ( ) ?. peek_mut ( ) . enter ( |tcx| tcx. analysis ( LOCAL_CRATE ) ) ?;
384396
385- if callbacks. after_analysis ( compiler) == Compilation :: Stop {
397+ if callbacks. after_analysis ( compiler, queries ) == Compilation :: Stop {
386398 return early_exit ( ) ;
387399 }
388400
0 commit comments