1
Fork 0

Mark GAT WC as GoalSource::AliasWellFormed so that we recurse into them in error reporting

This commit is contained in:
Michael Goulet 2025-03-26 18:59:44 +00:00
parent 27836e1e57
commit ccdfd310be
4 changed files with 9 additions and 25 deletions

View file

@ -134,7 +134,7 @@ where
// Add GAT where clauses from the trait's definition
// FIXME: We don't need these, since these are the type's own WF obligations.
ecx.add_goals(
GoalSource::Misc,
GoalSource::AliasWellFormed,
cx.own_predicates_of(goal.predicate.def_id())
.iter_instantiated(cx, goal.predicate.alias.args)
.map(|pred| goal.with(cx, pred)),
@ -199,7 +199,7 @@ where
// Add GAT where clauses from the trait's definition.
// FIXME: We don't need these, since these are the type's own WF obligations.
ecx.add_goals(
GoalSource::Misc,
GoalSource::AliasWellFormed,
cx.own_predicates_of(goal.predicate.def_id())
.iter_instantiated(cx, goal.predicate.alias.args)
.map(|pred| goal.with(cx, pred)),

View file

@ -83,8 +83,11 @@ pub enum GoalSource {
/// Instantiating a higher-ranked goal and re-proving it.
InstantiateHigherRanked,
/// Predicate required for an alias projection to be well-formed.
/// This is used in two places: projecting to an opaque whose hidden type
/// is already registered in the opaque type storage, and for rigid projections.
/// This is used in three places:
/// 1. projecting to an opaque whose hidden type is already registered in
/// the opaque type storage,
/// 2. for rigid projections's trait goal,
/// 3. for GAT where clauses.
AliasWellFormed,
/// In case normalizing aliases in nested goals cycles, eagerly normalizing these
/// aliases in the context of the parent may incorrectly change the cycle kind.