@@ -118,13 +118,15 @@ impl<'tcx> WipProbe<'tcx> {
118
118
119
119
#[ derive( Eq , PartialEq , Debug ) ]
120
120
pub enum WipProbeStep < ' tcx > {
121
+ AddGoal ( Goal < ' tcx , ty:: Predicate < ' tcx > > ) ,
121
122
EvaluateGoals ( WipAddedGoalsEvaluation < ' tcx > ) ,
122
123
NestedProbe ( WipProbe < ' tcx > ) ,
123
124
}
124
125
125
126
impl < ' tcx > WipProbeStep < ' tcx > {
126
127
pub fn finalize ( self ) -> inspect:: ProbeStep < ' tcx > {
127
128
match self {
129
+ WipProbeStep :: AddGoal ( goal) => inspect:: ProbeStep :: AddGoal ( goal) ,
128
130
WipProbeStep :: EvaluateGoals ( eval) => inspect:: ProbeStep :: EvaluateGoals ( eval. finalize ( ) ) ,
129
131
WipProbeStep :: NestedProbe ( probe) => inspect:: ProbeStep :: NestedProbe ( probe. finalize ( ) ) ,
130
132
}
@@ -370,6 +372,21 @@ impl<'tcx> ProofTreeBuilder<'tcx> {
370
372
}
371
373
}
372
374
375
+ pub fn add_goal ( & mut self , goal : Goal < ' tcx , ty:: Predicate < ' tcx > > ) {
376
+ if let Some ( this) = self . as_mut ( ) {
377
+ match this {
378
+ DebugSolver :: GoalEvaluationStep ( WipGoalEvaluationStep {
379
+ evaluation : WipProbe { steps, .. } ,
380
+ ..
381
+ } )
382
+ | DebugSolver :: Probe ( WipProbe { steps, .. } ) => {
383
+ steps. push ( WipProbeStep :: AddGoal ( goal) )
384
+ }
385
+ _ => unreachable ! ( ) ,
386
+ }
387
+ }
388
+ }
389
+
373
390
pub fn finish_probe ( & mut self , probe : ProofTreeBuilder < ' tcx > ) {
374
391
if let Some ( this) = self . as_mut ( ) {
375
392
match ( this, probe. state . unwrap ( ) . tree ) {
0 commit comments