@@ -103,25 +103,34 @@ impl<'tcx> WipGoalEvaluationStep<'tcx> {
103
103
104
104
#[ derive( Eq , PartialEq , Debug ) ]
105
105
pub struct WipProbe < ' tcx > {
106
- pub added_goals_evaluations : Vec < WipAddedGoalsEvaluation < ' tcx > > ,
107
- pub nested_probes : Vec < WipProbe < ' tcx > > ,
106
+ pub steps : Vec < WipProbeStep < ' tcx > > ,
108
107
pub kind : Option < ProbeKind < ' tcx > > ,
109
108
}
110
109
111
110
impl < ' tcx > WipProbe < ' tcx > {
112
111
pub fn finalize ( self ) -> inspect:: Probe < ' tcx > {
113
112
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 ( ) ,
120
114
kind : self . kind . unwrap ( ) ,
121
115
}
122
116
}
123
117
}
124
118
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
+
125
134
#[ derive( Debug ) ]
126
135
pub enum DebugSolver < ' tcx > {
127
136
Root ,
@@ -329,11 +338,7 @@ impl<'tcx> ProofTreeBuilder<'tcx> {
329
338
) -> ProofTreeBuilder < ' tcx > {
330
339
self . nested ( || WipGoalEvaluationStep {
331
340
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 } ,
337
342
} )
338
343
}
339
344
pub fn goal_evaluation_step ( & mut self , goal_evaluation_step : ProofTreeBuilder < ' tcx > ) {
@@ -351,11 +356,7 @@ impl<'tcx> ProofTreeBuilder<'tcx> {
351
356
}
352
357
353
358
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 } )
359
360
}
360
361
361
362
pub fn probe_kind ( & mut self , probe_kind : ProbeKind < ' tcx > ) {
@@ -373,13 +374,13 @@ impl<'tcx> ProofTreeBuilder<'tcx> {
373
374
if let Some ( this) = self . as_mut ( ) {
374
375
match ( this, probe. state . unwrap ( ) . tree ) {
375
376
(
376
- DebugSolver :: Probe ( WipProbe { nested_probes , .. } )
377
+ DebugSolver :: Probe ( WipProbe { steps , .. } )
377
378
| DebugSolver :: GoalEvaluationStep ( WipGoalEvaluationStep {
378
- evaluation : WipProbe { nested_probes , .. } ,
379
+ evaluation : WipProbe { steps , .. } ,
379
380
..
380
381
} ) ,
381
382
DebugSolver :: Probe ( probe) ,
382
- ) => nested_probes . push ( probe) ,
383
+ ) => steps . push ( WipProbeStep :: NestedProbe ( probe) ) ,
383
384
_ => unreachable ! ( ) ,
384
385
}
385
386
}
@@ -416,12 +417,12 @@ impl<'tcx> ProofTreeBuilder<'tcx> {
416
417
match ( this, added_goals_evaluation. state . unwrap ( ) . tree ) {
417
418
(
418
419
DebugSolver :: GoalEvaluationStep ( WipGoalEvaluationStep {
419
- evaluation : WipProbe { added_goals_evaluations , .. } ,
420
+ evaluation : WipProbe { steps , .. } ,
420
421
..
421
422
} )
422
- | DebugSolver :: Probe ( WipProbe { added_goals_evaluations , .. } ) ,
423
+ | DebugSolver :: Probe ( WipProbe { steps , .. } ) ,
423
424
DebugSolver :: AddedGoalsEvaluation ( added_goals_evaluation) ,
424
- ) => added_goals_evaluations . push ( added_goals_evaluation) ,
425
+ ) => steps . push ( WipProbeStep :: EvaluateGoals ( added_goals_evaluation) ) ,
425
426
_ => unreachable ! ( ) ,
426
427
}
427
428
}
0 commit comments