@@ -9,6 +9,7 @@ use rustc_type_ir::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable};
99use rustc_type_ir:: inherent:: * ;
1010use rustc_type_ir:: relate:: Relate ;
1111use rustc_type_ir:: relate:: solver_relating:: RelateExt ;
12+ use rustc_type_ir:: search_graph:: PathKind ;
1213use rustc_type_ir:: visit:: { TypeSuperVisitable , TypeVisitable , TypeVisitableExt , TypeVisitor } ;
1314use rustc_type_ir:: { self as ty, CanonicalVarValues , InferCtxtLike , Interner , TypingMode } ;
1415use rustc_type_ir_macros:: { Lift_Generic , TypeFoldable_Generic , TypeVisitable_Generic } ;
@@ -230,6 +231,13 @@ where
230231 self . is_normalizes_to_goal = true ;
231232 }
232233
234+ pub ( super ) fn step_kind_for_source ( & self , source : GoalSource ) -> PathKind {
235+ match source {
236+ GoalSource :: ImplWhereBound => PathKind :: Coinductive ,
237+ _ => PathKind :: Inductive ,
238+ }
239+ }
240+
233241 /// Creates a root evaluation context and search graph. This should only be
234242 /// used from outside of any evaluation, and other methods should be preferred
235243 /// over using this manually (such as [`SolverDelegateEvalExt::evaluate_root_goal`]).
@@ -340,6 +348,7 @@ where
340348 cx : I ,
341349 search_graph : & ' a mut SearchGraph < D > ,
342350 canonical_input : CanonicalInput < I > ,
351+ step_kind_from_parent : PathKind ,
343352 goal_evaluation : & mut ProofTreeBuilder < D > ,
344353 ) -> QueryResult < I > {
345354 let mut canonical_goal_evaluation =
@@ -352,6 +361,7 @@ where
352361 search_graph. with_new_goal (
353362 cx,
354363 canonical_input,
364+ step_kind_from_parent,
355365 & mut canonical_goal_evaluation,
356366 |search_graph, canonical_goal_evaluation| {
357367 EvalCtxt :: enter_canonical (
@@ -395,12 +405,10 @@ where
395405 /// `NormalizesTo` is only used by `AliasRelate`, all other callsites
396406 /// should use [`EvalCtxt::evaluate_goal`] which discards that empty
397407 /// storage.
398- // FIXME(-Znext-solver=coinduction): `_source` is currently unused but will
399- // be necessary once we implement the new coinduction approach.
400408 pub ( super ) fn evaluate_goal_raw (
401409 & mut self ,
402410 goal_evaluation_kind : GoalEvaluationKind ,
403- _source : GoalSource ,
411+ source : GoalSource ,
404412 goal : Goal < I , I :: Predicate > ,
405413 ) -> Result < ( NestedNormalizationGoals < I > , HasChanged , Certainty ) , NoSolution > {
406414 let ( orig_values, canonical_goal) = self . canonicalize_goal ( goal) ;
@@ -410,6 +418,7 @@ where
410418 self . cx ( ) ,
411419 self . search_graph ,
412420 canonical_goal,
421+ self . step_kind_for_source ( source) ,
413422 & mut goal_evaluation,
414423 ) ;
415424 let response = match canonical_response {
0 commit comments