about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/check/wfcheck.rs
diff options
context:
space:
mode:
authorbohan <bohan-zhang@foxmail.com>2025-07-13 02:52:03 +0800
committerbohan <bohan-zhang@foxmail.com>2025-07-13 02:52:13 +0800
commit47e15d90e13b5238117971298a3573ddebd87a40 (patch)
treea87477f39fa2912da6a28b2f1a13f6f0f6a77af2 /compiler/rustc_hir_analysis/src/check/wfcheck.rs
parentdc6c3300fcf520b2931355e922caa66758becb71 (diff)
downloadrust-47e15d90e13b5238117971298a3573ddebd87a40.tar.gz
rust-47e15d90e13b5238117971298a3573ddebd87a40.zip
query RPITIT in a trait or impl
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/wfcheck.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/check/wfcheck.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
index 428d627ad6f..3d3fdd899d3 100644
--- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs
+++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
@@ -20,7 +20,7 @@ use rustc_middle::ty::trait_def::TraitSpecializationKind;
 use rustc_middle::ty::{
     self, AdtKind, GenericArgKind, GenericArgs, GenericParamDefKind, Ty, TyCtxt, TypeFlags,
     TypeFoldable, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, TypingMode,
-    Upcast,
+    Upcast, associated_types_for_impl_traits_in_associated_fn,
 };
 use rustc_middle::{bug, span_bug};
 use rustc_session::parse::feature_err;
@@ -326,7 +326,9 @@ pub(crate) fn check_trait_item<'tcx>(
     let mut res = Ok(());
 
     if matches!(tcx.def_kind(def_id), DefKind::AssocFn) {
-        for &assoc_ty_def_id in tcx.associated_types_for_impl_traits_in_associated_fn(def_id) {
+        for &assoc_ty_def_id in
+            associated_types_for_impl_traits_in_associated_fn(tcx, def_id.to_def_id())
+        {
             res = res.and(check_associated_item(tcx, assoc_ty_def_id.expect_local()));
         }
     }