@@ -118,13 +118,15 @@ impl<'tcx> WipProbe<'tcx> {
118118
119119#[ derive( Eq , PartialEq , Debug ) ]
120120pub enum WipProbeStep < ' tcx > {
121+ AddGoal ( Goal < ' tcx , ty:: Predicate < ' tcx > > ) ,
121122 EvaluateGoals ( WipAddedGoalsEvaluation < ' tcx > ) ,
122123 NestedProbe ( WipProbe < ' tcx > ) ,
123124}
124125
125126impl < ' tcx > WipProbeStep < ' tcx > {
126127 pub fn finalize ( self ) -> inspect:: ProbeStep < ' tcx > {
127128 match self {
129+ WipProbeStep :: AddGoal ( goal) => inspect:: ProbeStep :: AddGoal ( goal) ,
128130 WipProbeStep :: EvaluateGoals ( eval) => inspect:: ProbeStep :: EvaluateGoals ( eval. finalize ( ) ) ,
129131 WipProbeStep :: NestedProbe ( probe) => inspect:: ProbeStep :: NestedProbe ( probe. finalize ( ) ) ,
130132 }
@@ -370,6 +372,21 @@ impl<'tcx> ProofTreeBuilder<'tcx> {
370372 }
371373 }
372374
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+
373390 pub fn finish_probe ( & mut self , probe : ProofTreeBuilder < ' tcx > ) {
374391 if let Some ( this) = self . as_mut ( ) {
375392 match ( this, probe. state . unwrap ( ) . tree ) {
0 commit comments