about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-12-23 20:17:53 +0000
committerMichael Goulet <michael@errs.io>2025-01-06 17:58:42 +0000
commitebdf19a8bbd1efb533bab35b0a2b327e4a33282f (patch)
tree074293f94d79462076f8f2adaeaece3f5fed210c /compiler/rustc_trait_selection/src
parent2be9ffc1afd0623ab0697cbaca5693b80c6d362c (diff)
downloadrust-ebdf19a8bbd1efb533bab35b0a2b327e4a33282f.tar.gz
rust-ebdf19a8bbd1efb533bab35b0a2b327e4a33282f.zip
Recurse on GAT where clauses in fulfillment error proof tree visitor
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/solve/fulfill.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/fulfill.rs b/compiler/rustc_trait_selection/src/solve/fulfill.rs
index 7aa82c52c9f..986176aca77 100644
--- a/compiler/rustc_trait_selection/src/solve/fulfill.rs
+++ b/compiler/rustc_trait_selection/src/solve/fulfill.rs
@@ -413,6 +413,7 @@ impl<'tcx> BestObligation<'tcx> {
                                     matches!(
                                         nested_goal.source(),
                                         GoalSource::ImplWhereBound
+                                            | GoalSource::AliasBoundConstCondition
                                             | GoalSource::InstantiateHigherRanked
                                             | GoalSource::AliasWellFormed
                                     ) && match self.consider_ambiguities {
@@ -495,7 +496,6 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
         };
 
         let mut impl_where_bound_count = 0;
-        let mut impl_const_condition_bound_count = 0;
         for nested_goal in candidate.instantiate_nested_goals(self.span()) {
             trace!(nested_goal = ?(nested_goal.goal(), nested_goal.source(), nested_goal.result()));
 
@@ -521,21 +521,25 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
                     ));
                     impl_where_bound_count += 1;
                 }
-                (ChildMode::Host(parent_host_pred), GoalSource::ImplWhereBound) => {
+                (
+                    ChildMode::Host(parent_host_pred),
+                    GoalSource::ImplWhereBound | GoalSource::AliasBoundConstCondition,
+                ) => {
                     obligation = make_obligation(derive_host_cause(
                         tcx,
                         candidate.kind(),
                         self.obligation.cause.clone(),
-                        impl_const_condition_bound_count,
+                        impl_where_bound_count,
                         parent_host_pred,
                     ));
-                    impl_const_condition_bound_count += 1;
+                    impl_where_bound_count += 1;
                 }
                 // Skip over a higher-ranked predicate.
                 (_, GoalSource::InstantiateHigherRanked) => {
                     obligation = self.obligation.clone();
                 }
-                (ChildMode::PassThrough, _) | (_, GoalSource::AliasWellFormed) => {
+                (ChildMode::PassThrough, _)
+                | (_, GoalSource::AliasWellFormed | GoalSource::AliasBoundConstCondition) => {
                     obligation = make_obligation(self.obligation.cause.clone());
                 }
             }