about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-12 03:51:54 +0000
committerbors <bors@rust-lang.org>2025-09-12 03:51:54 +0000
commit8e2ed71effd5f81bff319c0c7adaca42084e2a71 (patch)
tree9036671b06a3ec003c2c4ff0aebf39045fd33b5d /compiler/rustc_hir_analysis
parent2a9bacf6187685931d52346a0ecff2e52bdc91cc (diff)
parent7e826fb14be36b4faf879c3aa1fe1a50b5750a5b (diff)
downloadrust-8e2ed71effd5f81bff319c0c7adaca42084e2a71.tar.gz
rust-8e2ed71effd5f81bff319c0c7adaca42084e2a71.zip
Auto merge of #146328 - zetanumbers:fix-141951, r=lcnr
Skip typeck for items w/o their own typeck context

Skip items which forward typeck to their ancestor.

Should remove some potential but unnecessary typeck query waits, hence might improve performance for the parallel frontend.

Thanks to `@ywxt` for a fix suggestion

Fixes rust-lang/rust#141951
Diffstat (limited to 'compiler/rustc_hir_analysis')
-rw-r--r--compiler/rustc_hir_analysis/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs
index 2562ab7542a..6659aff7111 100644
--- a/compiler/rustc_hir_analysis/src/lib.rs
+++ b/compiler/rustc_hir_analysis/src/lib.rs
@@ -238,7 +238,8 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
             _ => (),
         }
         // Skip `AnonConst`s because we feed their `type_of`.
-        if !matches!(def_kind, DefKind::AnonConst) {
+        // Also skip items for which typeck forwards to parent typeck.
+        if !(matches!(def_kind, DefKind::AnonConst) || def_kind.is_typeck_child()) {
             tcx.ensure_ok().typeck(item_def_id);
         }
         // Ensure we generate the new `DefId` before finishing `check_crate`.