@@ -34,9 +34,9 @@ pub struct InspectConfig {
3434pub struct InspectGoal < ' a , ' tcx > {
3535 infcx : & ' a InferCtxt < ' tcx > ,
3636 depth : usize ,
37- orig_values : & ' a [ ty:: GenericArg < ' tcx > ] ,
37+ orig_values : Vec < ty:: GenericArg < ' tcx > > ,
3838 goal : Goal < ' tcx , ty:: Predicate < ' tcx > > ,
39- evaluation : & ' a inspect:: GoalEvaluation < ' tcx > ,
39+ evaluation : inspect:: CanonicalGoalEvaluation < ' tcx > ,
4040}
4141
4242pub struct InspectCandidate < ' a , ' tcx > {
@@ -139,7 +139,7 @@ impl<'a, 'tcx> InspectCandidate<'a, 'tcx> {
139139 try_visit ! ( visitor. visit_goal( & InspectGoal :: new(
140140 infcx,
141141 self . goal. depth + 1 ,
142- & proof_tree. unwrap( ) ,
142+ proof_tree. unwrap( ) ,
143143 ) ) ) ;
144144 }
145145 }
@@ -164,7 +164,7 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> {
164164 }
165165
166166 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 )
168168 }
169169
170170 fn candidates_recur (
@@ -221,7 +221,7 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> {
221221
222222 pub fn candidates ( & ' a self ) -> Vec < InspectCandidate < ' a , ' tcx > > {
223223 let mut candidates = vec ! [ ] ;
224- let last_eval_step = match self . evaluation . evaluation . kind {
224+ let last_eval_step = match self . evaluation . kind {
225225 inspect:: CanonicalGoalEvaluationKind :: Overflow
226226 | inspect:: CanonicalGoalEvaluationKind :: CycleInStack
227227 | inspect:: CanonicalGoalEvaluationKind :: ProvisionalCacheHit => {
@@ -254,18 +254,15 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> {
254254 candidates. pop ( ) . filter ( |_| candidates. is_empty ( ) )
255255 }
256256
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 {
264261 infcx,
265262 depth,
266263 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,
269266 } ,
270267 inspect:: GoalEvaluationKind :: Nested { .. } => unreachable ! ( ) ,
271268 }
@@ -294,6 +291,6 @@ impl<'tcx> InferCtxt<'tcx> {
294291 ) -> V :: Result {
295292 let ( _, proof_tree) = self . evaluate_root_goal ( goal, GenerateProofTree :: Yes ) ;
296293 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) )
298295 }
299296}
0 commit comments