@@ -34,9 +34,9 @@ pub struct InspectConfig {
34
34
pub struct InspectGoal<'a, 'tcx> {
35
35
infcx: &'a InferCtxt<'tcx>,
36
36
depth: usize,
37
- orig_values: &'a [ ty::GenericArg<'tcx>] ,
37
+ orig_values: Vec< ty::GenericArg<'tcx>> ,
38
38
goal: Goal<'tcx, ty::Predicate<'tcx>>,
39
- evaluation: &'a inspect::GoalEvaluation <'tcx>,
39
+ evaluation: inspect::CanonicalGoalEvaluation <'tcx>,
40
40
}
41
41
42
42
pub struct InspectCandidate<'a, 'tcx> {
@@ -139,7 +139,7 @@ impl<'a, 'tcx> InspectCandidate<'a, 'tcx> {
139
139
try_visit!(visitor.visit_goal(&InspectGoal::new(
140
140
infcx,
141
141
self.goal.depth + 1,
142
- & proof_tree.unwrap(),
142
+ proof_tree.unwrap(),
143
143
)));
144
144
}
145
145
}
@@ -164,7 +164,7 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> {
164
164
}
165
165
166
166
pub fn result(&self) -> Result<Certainty, NoSolution> {
167
- self.evaluation.evaluation. result.map(|c| c.value.certainty)
167
+ self.evaluation.result.map(|c| c.value.certainty)
168
168
}
169
169
170
170
fn candidates_recur(
@@ -221,7 +221,7 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> {
221
221
222
222
pub fn candidates(&'a self) -> Vec<InspectCandidate<'a, 'tcx>> {
223
223
let mut candidates = vec![];
224
- let last_eval_step = match self.evaluation.evaluation. kind {
224
+ let last_eval_step = match self.evaluation.kind {
225
225
inspect::CanonicalGoalEvaluationKind::Overflow
226
226
| inspect::CanonicalGoalEvaluationKind::CycleInStack
227
227
| inspect::CanonicalGoalEvaluationKind::ProvisionalCacheHit => {
@@ -254,18 +254,15 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> {
254
254
candidates.pop().filter(|_| candidates.is_empty())
255
255
}
256
256
257
- fn new(
258
- infcx: &'a InferCtxt<'tcx>,
259
- depth: usize,
260
- root: &'a inspect::GoalEvaluation<'tcx>,
261
- ) -> Self {
262
- match root.kind {
263
- inspect::GoalEvaluationKind::Root { ref orig_values } => InspectGoal {
257
+ fn new(infcx: &'a InferCtxt<'tcx>, depth: usize, root: inspect::GoalEvaluation<'tcx>) -> Self {
258
+ let inspect::GoalEvaluation { uncanonicalized_goal, kind, evaluation } = root;
259
+ match kind {
260
+ inspect::GoalEvaluationKind::Root { orig_values } => InspectGoal {
264
261
infcx,
265
262
depth,
266
263
orig_values,
267
- goal: root. uncanonicalized_goal.fold_with(&mut EagerResolver::new(infcx)),
268
- evaluation: root ,
264
+ goal: uncanonicalized_goal.fold_with(&mut EagerResolver::new(infcx)),
265
+ evaluation,
269
266
},
270
267
inspect::GoalEvaluationKind::Nested { .. } => unreachable!(),
271
268
}
@@ -294,6 +291,6 @@ impl<'tcx> InferCtxt<'tcx> {
294
291
) -> V::Result {
295
292
let (_, proof_tree) = self.evaluate_root_goal(goal, GenerateProofTree::Yes);
296
293
let proof_tree = proof_tree.unwrap();
297
- visitor.visit_goal(&InspectGoal::new(self, 0, & proof_tree))
294
+ visitor.visit_goal(&InspectGoal::new(self, 0, proof_tree))
298
295
}
299
296
}
0 commit comments