@@ -103,25 +103,34 @@ impl<'tcx> WipGoalEvaluationStep<'tcx> {
103103
104104#[ derive( Eq , PartialEq , Debug ) ]
105105pub struct WipProbe < ' tcx > {
106- pub added_goals_evaluations : Vec < WipAddedGoalsEvaluation < ' tcx > > ,
107- pub nested_probes : Vec < WipProbe < ' tcx > > ,
106+ pub steps : Vec < WipProbeStep < ' tcx > > ,
108107 pub kind : Option < ProbeKind < ' tcx > > ,
109108}
110109
111110impl < ' tcx > WipProbe < ' tcx > {
112111 pub fn finalize ( self ) -> inspect:: Probe < ' tcx > {
113112 inspect:: Probe {
114- added_goals_evaluations : self
115- . added_goals_evaluations
116- . into_iter ( )
117- . map ( WipAddedGoalsEvaluation :: finalize)
118- . collect ( ) ,
119- nested_probes : self . nested_probes . into_iter ( ) . map ( WipProbe :: finalize) . collect ( ) ,
113+ steps : self . steps . into_iter ( ) . map ( WipProbeStep :: finalize) . collect ( ) ,
120114 kind : self . kind . unwrap ( ) ,
121115 }
122116 }
123117}
124118
119+ #[ derive( Eq , PartialEq , Debug ) ]
120+ pub enum WipProbeStep < ' tcx > {
121+ EvaluateGoals ( WipAddedGoalsEvaluation < ' tcx > ) ,
122+ NestedProbe ( WipProbe < ' tcx > ) ,
123+ }
124+
125+ impl < ' tcx > WipProbeStep < ' tcx > {
126+ pub fn finalize ( self ) -> inspect:: ProbeStep < ' tcx > {
127+ match self {
128+ WipProbeStep :: EvaluateGoals ( eval) => inspect:: ProbeStep :: EvaluateGoals ( eval. finalize ( ) ) ,
129+ WipProbeStep :: NestedProbe ( probe) => inspect:: ProbeStep :: NestedProbe ( probe. finalize ( ) ) ,
130+ }
131+ }
132+ }
133+
125134#[ derive( Debug ) ]
126135pub enum DebugSolver < ' tcx > {
127136 Root ,
@@ -329,11 +338,7 @@ impl<'tcx> ProofTreeBuilder<'tcx> {
329338 ) -> ProofTreeBuilder < ' tcx > {
330339 self . nested ( || WipGoalEvaluationStep {
331340 instantiated_goal,
332- evaluation : WipProbe {
333- added_goals_evaluations : vec ! [ ] ,
334- nested_probes : vec ! [ ] ,
335- kind : None ,
336- } ,
341+ evaluation : WipProbe { steps : vec ! [ ] , kind : None } ,
337342 } )
338343 }
339344 pub fn goal_evaluation_step ( & mut self , goal_evaluation_step : ProofTreeBuilder < ' tcx > ) {
@@ -351,11 +356,7 @@ impl<'tcx> ProofTreeBuilder<'tcx> {
351356 }
352357
353358 pub fn new_probe ( & mut self ) -> ProofTreeBuilder < ' tcx > {
354- self . nested ( || WipProbe {
355- added_goals_evaluations : vec ! [ ] ,
356- nested_probes : vec ! [ ] ,
357- kind : None ,
358- } )
359+ self . nested ( || WipProbe { steps : vec ! [ ] , kind : None } )
359360 }
360361
361362 pub fn probe_kind ( & mut self , probe_kind : ProbeKind < ' tcx > ) {
@@ -373,13 +374,13 @@ impl<'tcx> ProofTreeBuilder<'tcx> {
373374 if let Some ( this) = self . as_mut ( ) {
374375 match ( this, probe. state . unwrap ( ) . tree ) {
375376 (
376- DebugSolver :: Probe ( WipProbe { nested_probes , .. } )
377+ DebugSolver :: Probe ( WipProbe { steps , .. } )
377378 | DebugSolver :: GoalEvaluationStep ( WipGoalEvaluationStep {
378- evaluation : WipProbe { nested_probes , .. } ,
379+ evaluation : WipProbe { steps , .. } ,
379380 ..
380381 } ) ,
381382 DebugSolver :: Probe ( probe) ,
382- ) => nested_probes . push ( probe) ,
383+ ) => steps . push ( WipProbeStep :: NestedProbe ( probe) ) ,
383384 _ => unreachable ! ( ) ,
384385 }
385386 }
@@ -416,12 +417,12 @@ impl<'tcx> ProofTreeBuilder<'tcx> {
416417 match ( this, added_goals_evaluation. state . unwrap ( ) . tree ) {
417418 (
418419 DebugSolver :: GoalEvaluationStep ( WipGoalEvaluationStep {
419- evaluation : WipProbe { added_goals_evaluations , .. } ,
420+ evaluation : WipProbe { steps , .. } ,
420421 ..
421422 } )
422- | DebugSolver :: Probe ( WipProbe { added_goals_evaluations , .. } ) ,
423+ | DebugSolver :: Probe ( WipProbe { steps , .. } ) ,
423424 DebugSolver :: AddedGoalsEvaluation ( added_goals_evaluation) ,
424- ) => added_goals_evaluations . push ( added_goals_evaluation) ,
425+ ) => steps . push ( WipProbeStep :: EvaluateGoals ( added_goals_evaluation) ) ,
425426 _ => unreachable ! ( ) ,
426427 }
427428 }
0 commit comments