Skip to content

Commit

Permalink
Clarify explicit_predicates_of is_assoc_item_ty comment
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Dec 13, 2022
1 parent 4ae0c55 commit b22769a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions compiler/rustc_hir_analysis/src/collect/predicates_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit b22769a

Please sign in to comment.