about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2022-12-12 16:46:18 -0300
committerSantiago Pastorino <spastorino@gmail.com>2022-12-13 09:41:12 -0300
commitb22769a7bdd40ba01bf0792c86ba763a525d8857 (patch)
treeb0f4f1711c859e76c1b0ac02d5feafaf7c148126
parent4ae0c5518d0d8a835a84bac05dc1691aca06222e (diff)
Clarify explicit_predicates_of is_assoc_item_ty comment
-rw-r--r--compiler/rustc_hir_analysis/src/collect/predicates_of.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs
index d7dd015fb68..19a1b5da41d 100644
--- a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs
+++ b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs
@@ -402,9 +402,10 @@ pub(super) fn explicit_predicates_of<'tcx>(
             // For a predicate from a where clause to become a bound on an
             // associated type:
             // * It must use the identity substs of the item.
-            //     * Since any generic parameters on the item are not in scope,
-            //       this means that the item is not a GAT, and its identity
-            //       substs are the same as the trait's.
+            //   * We're in the scope of the trait, so we can't name any
+            //     parameters of the GAT. That means that all we need to
+            //     check are that the substs of the projection are the
+            //     identity substs of the trait.
             // * It must be an associated type for this trait (*not* a
             //   supertrait).
             if let ty::Projection(projection) = ty.kind() {