about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/passes.rs
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2024-03-02 18:32:42 +0100
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2025-04-29 14:03:07 +0200
commitef9403371f2d4759cd7b0d0a276e63aae2ce68fe (patch)
treee08c50bc567a888aa52f2d4d346bf846c867bfc1 /compiler/rustc_interface/src/passes.rs
parentefcbb94dccbe0fcc1076f031f88332db4a6a2a52 (diff)
downloadrust-ef9403371f2d4759cd7b0d0a276e63aae2ce68fe.tar.gz
rust-ef9403371f2d4759cd7b0d0a276e63aae2ce68fe.zip
Drop AST on a separate thread and prefetch `hir_crate`
Diffstat (limited to 'compiler/rustc_interface/src/passes.rs')
-rw-r--r--compiler/rustc_interface/src/passes.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 66d2a79b93a..aad63f4edcf 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -900,6 +900,12 @@ fn run_required_analyses(tcx: TyCtxt<'_>) {
     // is not defined. So we need to cfg it out.
     #[cfg(all(not(doc), debug_assertions))]
     rustc_passes::hir_id_validator::check_crate(tcx);
+
+    // Prefetch this to prevent multiple threads from blocking on it later.
+    // This is needed since the `hir_id_validator::check_crate` call above is not guaranteed
+    // to use `hir_crate`.
+    tcx.ensure_done().hir_crate(());
+
     let sess = tcx.sess;
     sess.time("misc_checking_1", || {
         parallel!(