Skip to content

Commit b22769a

Browse files
committed
Clarify explicit_predicates_of is_assoc_item_ty comment
1 parent 4ae0c55 commit b22769a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,10 @@ pub(super) fn explicit_predicates_of<'tcx>(
402402
// For a predicate from a where clause to become a bound on an
403403
// associated type:
404404
// * It must use the identity substs of the item.
405-
// * Since any generic parameters on the item are not in scope,
406-
// this means that the item is not a GAT, and its identity
407-
// substs are the same as the trait's.
405+
// * We're in the scope of the trait, so we can't name any
406+
// parameters of the GAT. That means that all we need to
407+
// check are that the substs of the projection are the
408+
// identity substs of the trait.
408409
// * It must be an associated type for this trait (*not* a
409410
// supertrait).
410411
if let ty::Projection(projection) = ty.kind() {

0 commit comments

Comments
 (0)