Skip to content

Commit 0ed2914

Browse files
committed
Rename after_parsing callback to after_crate_root_parsing
To avoid confusion if it is called after all parsing is done or not.
1 parent dda95c1 commit 0ed2914

File tree

1 file changed

+4
-3
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+4
-3
lines changed

compiler/rustc_driver_impl/src/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,10 @@ pub fn abort_on_err<T>(result: Result<T, ErrorGuaranteed>, sess: &Session) -> T
162162
pub 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>,
@@ -407,7 +408,7 @@ fn run_compiler(
407408
return early_exit();
408409
}
409410

410-
if callbacks.after_parsing(compiler, queries) == Compilation::Stop {
411+
if callbacks.after_crate_root_parsing(compiler, queries) == Compilation::Stop {
411412
return early_exit();
412413
}
413414

0 commit comments

Comments
 (0)