@@ -162,9 +162,10 @@ pub fn abort_on_err<T>(result: Result<T, ErrorGuaranteed>, sess: &Session) -> T
162162pub trait Callbacks {
163163 /// Called before creating the compiler instance
164164 fn config( & mut self , _config: & mut interface:: Config ) { }
165- /// Called after parsing. Return value instructs the compiler whether to
165+ /// Called after parsing the crate root. Submodules are not yet parsed when
166+ /// this callback is called. Return value instructs the compiler whether to
166167 /// continue the compilation afterwards (defaults to `Compilation::Continue`)
167- fn after_parsing <' tcx>(
168+ fn after_crate_root_parsing <' tcx>(
168169 & mut self ,
169170 _compiler: & interface:: Compiler ,
170171 _queries: & ' tcx Queries <' tcx>,
@@ -184,7 +185,6 @@ pub trait Callbacks {
184185 /// continue the compilation afterwards (defaults to `Compilation::Continue`)
185186 fn after_analysis<' tcx>(
186187 & mut self ,
187- _handler: & EarlyErrorHandler ,
188188 _compiler: & interface:: Compiler ,
189189 _queries: & ' tcx Queries <' tcx>,
190190 ) -> Compilation {
@@ -407,7 +407,7 @@ fn run_compiler(
407407 return early_exit( ) ;
408408 }
409409
410- if callbacks. after_parsing ( compiler, queries) == Compilation :: Stop {
410+ if callbacks. after_crate_root_parsing ( compiler, queries) == Compilation :: Stop {
411411 return early_exit( ) ;
412412 }
413413
@@ -445,7 +445,7 @@ fn run_compiler(
445445
446446 queries. global_ctxt( ) ?. enter( |tcx| tcx. analysis( ( ) ) ) ?;
447447
448- if callbacks. after_analysis( & handler , compiler, queries) == Compilation :: Stop {
448+ if callbacks. after_analysis( compiler, queries) == Compilation :: Stop {
449449 return early_exit( ) ;
450450 }
451451
0 commit comments