about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-09-10 09:31:10 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-09-10 09:31:10 +0000
commit0ed291453da7b7233f1b6f6535a2d7e80610d568 (patch)
tree3a05397958439a3be5c6d138584492d98972e7a0
parentdda95c14e1a9356397c6369762047db031e69461 (diff)
downloadrust-0ed291453da7b7233f1b6f6535a2d7e80610d568.tar.gz
rust-0ed291453da7b7233f1b6f6535a2d7e80610d568.zip
Rename after_parsing callback to after_crate_root_parsing
To avoid confusion if it is called after all parsing is done or not.
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index e56347ab38e..0fe5a966199 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -162,9 +162,10 @@ pub fn abort_on_err<T>(result: Result<T, ErrorGuaranteed>, sess: &Session) -> T
 pub trait Callbacks {
     /// Called before creating the compiler instance
     fn config(&mut self, _config: &mut interface::Config) {}
-    /// Called after parsing. Return value instructs the compiler whether to
+    /// Called after parsing the crate root. Submodules are not yet parsed when
+    /// this callback is called. Return value instructs the compiler whether to
     /// continue the compilation afterwards (defaults to `Compilation::Continue`)
-    fn after_parsing<'tcx>(
+    fn after_crate_root_parsing<'tcx>(
         &mut self,
         _compiler: &interface::Compiler,
         _queries: &'tcx Queries<'tcx>,
@@ -407,7 +408,7 @@ fn run_compiler(
                 return early_exit();
             }
 
-            if callbacks.after_parsing(compiler, queries) == Compilation::Stop {
+            if callbacks.after_crate_root_parsing(compiler, queries) == Compilation::Stop {
                 return early_exit();
             }