about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis
diff options
context:
space:
mode:
authorDaria Sukhonina <dariasukhonina@gmail.com>2025-09-08 14:32:26 +0300
committerDaria Sukhonina <dariasukhonina@gmail.com>2025-09-08 14:50:23 +0300
commit78718d55700865328d1abf584956125bec7f5d9d (patch)
tree1f906a8705d8b82faa6b154a4f811832a3db63ef /compiler/rustc_hir_analysis
parentbeeb8e3af54295ba494c250e84ecda4c2c5d85ff (diff)
downloadrust-78718d55700865328d1abf584956125bec7f5d9d.tar.gz
rust-78718d55700865328d1abf584956125bec7f5d9d.zip
Skip typeck for items w/o their own typeck context
More details on about this fix:

https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/ICE.3A.20typecks.20AnonConst.20under.20parallel.20rustc.28.23141951.29/with/538200980

Co-authored-by: ywxt <ywxtcwh@gmail.com>
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`.