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-13 08:48:44 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2025-06-30 08:45:43 +0000
commit5940109a0403ec55e7b922256e6e6f82d0c100a2 (patch)
tree69ba955f5193af86891e9838564db109c10d5692 /compiler/rustc_hir_analysis/src/check/check.rs
parentcb158c2119b44c3d2c61d8e2914d39aa02dfbb1f (diff)
downloadrust-5940109a0403ec55e7b922256e6e6f82d0c100a2.tar.gz
rust-5940109a0403ec55e7b922256e6e6f82d0c100a2.zip
Merge `lower_trait_item` and `lower_impl_item` into `check_item_type`
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/check.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/check/check.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs
index b72e838a010..e3f9ca64c58 100644
--- a/compiler/rustc_hir_analysis/src/check/check.rs
+++ b/compiler/rustc_hir_analysis/src/check/check.rs
@@ -976,6 +976,32 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
             // depends on typecheck and would therefore hide
             // any further errors in case one typeck fails.
         }
+        DefKind::AssocFn => {
+            tcx.ensure_ok().codegen_fn_attrs(def_id);
+            tcx.ensure_ok().type_of(def_id);
+            tcx.ensure_ok().fn_sig(def_id);
+            tcx.ensure_ok().predicates_of(def_id);
+        }
+        DefKind::AssocConst => {
+            tcx.ensure_ok().type_of(def_id);
+            tcx.ensure_ok().predicates_of(def_id);
+        }
+        DefKind::AssocTy => {
+            tcx.ensure_ok().predicates_of(def_id);
+
+            let assoc_item = tcx.associated_item(def_id);
+            let has_type = match assoc_item.container {
+                ty::AssocItemContainer::Impl => true,
+                ty::AssocItemContainer::Trait => {
+                    tcx.ensure_ok().item_bounds(def_id);
+                    tcx.ensure_ok().item_self_bounds(def_id);
+                    assoc_item.defaultness(tcx).has_value()
+                }
+            };
+            if has_type {
+                tcx.ensure_ok().type_of(def_id);
+            }
+        }
         _ => {}
     }
     res