@@ -9,6 +9,7 @@ use rustc_type_ir::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable};
9
9
use rustc_type_ir:: inherent:: * ;
10
10
use rustc_type_ir:: relate:: Relate ;
11
11
use rustc_type_ir:: relate:: solver_relating:: RelateExt ;
12
+ use rustc_type_ir:: search_graph:: PathKind ;
12
13
use rustc_type_ir:: visit:: { TypeSuperVisitable , TypeVisitable , TypeVisitableExt , TypeVisitor } ;
13
14
use rustc_type_ir:: { self as ty, CanonicalVarValues , InferCtxtLike , Interner , TypingMode } ;
14
15
use rustc_type_ir_macros:: { Lift_Generic , TypeFoldable_Generic , TypeVisitable_Generic } ;
@@ -230,6 +231,13 @@ where
230
231
self . is_normalizes_to_goal = true ;
231
232
}
232
233
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
+
233
241
/// Creates a root evaluation context and search graph. This should only be
234
242
/// used from outside of any evaluation, and other methods should be preferred
235
243
/// over using this manually (such as [`SolverDelegateEvalExt::evaluate_root_goal`]).
@@ -340,6 +348,7 @@ where
340
348
cx : I ,
341
349
search_graph : & ' a mut SearchGraph < D > ,
342
350
canonical_input : CanonicalInput < I > ,
351
+ step_kind_from_parent : PathKind ,
343
352
goal_evaluation : & mut ProofTreeBuilder < D > ,
344
353
) -> QueryResult < I > {
345
354
let mut canonical_goal_evaluation =
@@ -352,6 +361,7 @@ where
352
361
search_graph. with_new_goal (
353
362
cx,
354
363
canonical_input,
364
+ step_kind_from_parent,
355
365
& mut canonical_goal_evaluation,
356
366
|search_graph, canonical_goal_evaluation| {
357
367
EvalCtxt :: enter_canonical (
@@ -395,12 +405,10 @@ where
395
405
/// `NormalizesTo` is only used by `AliasRelate`, all other callsites
396
406
/// should use [`EvalCtxt::evaluate_goal`] which discards that empty
397
407
/// storage.
398
- // FIXME(-Znext-solver=coinduction): `_source` is currently unused but will
399
- // be necessary once we implement the new coinduction approach.
400
408
pub ( super ) fn evaluate_goal_raw (
401
409
& mut self ,
402
410
goal_evaluation_kind : GoalEvaluationKind ,
403
- _source : GoalSource ,
411
+ source : GoalSource ,
404
412
goal : Goal < I , I :: Predicate > ,
405
413
) -> Result < ( NestedNormalizationGoals < I > , HasChanged , Certainty ) , NoSolution > {
406
414
let ( orig_values, canonical_goal) = self . canonicalize_goal ( goal) ;
@@ -410,6 +418,7 @@ where
410
418
self . cx ( ) ,
411
419
self . search_graph ,
412
420
canonical_goal,
421
+ self . step_kind_for_source ( source) ,
413
422
& mut goal_evaluation,
414
423
) ;
415
424
let response = match canonical_response {
0 commit comments