about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/check/check.rs
diff options
context:
space:
mode:
authorOli Scherer <github333195615777966@oli-obk.de>2025-06-05 10:33:13 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2025-06-05 13:37:34 +0000
commitc83bd8b5f3207b25207408be24fc940afc3d8c24 (patch)
tree921b5115c061d196f3a852a12463e05a70152f11 /compiler/rustc_hir_analysis/src/check/check.rs
parent9949ea73c16e2de911ece49d3fceb649a6c11ef0 (diff)
downloadrust-c83bd8b5f3207b25207408be24fc940afc3d8c24.tar.gz
rust-c83bd8b5f3207b25207408be24fc940afc3d8c24.zip
wfcheck closures
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/check.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/check/check.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs
index 6a2d353dbbb..bcf0353498e 100644
--- a/compiler/rustc_hir_analysis/src/check/check.rs
+++ b/compiler/rustc_hir_analysis/src/check/check.rs
@@ -860,6 +860,15 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
                 }
             }
         }
+        DefKind::Closure => {
+            // This is guaranteed to be called by metadata encoding,
+            // we still call it in wfcheck eagerly to ensure errors in codegen
+            // attrs prevent lints from spamming the output.
+            tcx.ensure_ok().codegen_fn_attrs(def_id);
+            // We do not call `type_of` for closures here as that
+            // depends on typecheck and would therefore hide
+            // any further errors in case one typeck fails.
+        }
         _ => {}
     }
 }