@@ -12,13 +12,14 @@ use rustc_infer::traits::{
1212use rustc_middle:: bug;
1313use rustc_middle:: ty:: error:: { ExpectedFound , TypeError } ;
1414use rustc_middle:: ty:: { self , TyCtxt } ;
15+ use rustc_next_trait_solver:: solve:: { GenerateProofTree , SolverDelegateEvalExt as _} ;
1516use rustc_span:: symbol:: sym;
1617
1718use crate :: traits:: { FulfillmentError , FulfillmentErrorCode , ScrubbedTraitError } ;
1819
19- use super :: eval_ctxt :: GenerateProofTree ;
20+ use super :: infcx :: SolverDelegate ;
2021use super :: inspect:: { self , ProofTreeInferCtxtExt , ProofTreeVisitor } ;
21- use super :: { Certainty , InferCtxtEvalExt } ;
22+ use super :: Certainty ;
2223
2324/// A trait engine using the new trait solver.
2425///
@@ -83,7 +84,9 @@ impl<'tcx> ObligationStorage<'tcx> {
8384 // change.
8485 self . overflowed . extend ( self . pending . extract_if ( |o| {
8586 let goal = o. clone ( ) . into ( ) ;
86- let result = infcx. evaluate_root_goal ( goal, GenerateProofTree :: No ) . 0 ;
87+ let result = <& SolverDelegate < ' tcx > >:: from ( infcx)
88+ . evaluate_root_goal ( goal, GenerateProofTree :: No )
89+ . 0 ;
8790 match result {
8891 Ok ( ( has_changed, _) ) => has_changed,
8992 _ => false ,
@@ -165,7 +168,9 @@ where
165168 let mut has_changed = false ;
166169 for obligation in self . obligations . unstalled_for_select ( ) {
167170 let goal = obligation. clone ( ) . into ( ) ;
168- let result = infcx. evaluate_root_goal ( goal, GenerateProofTree :: No ) . 0 ;
171+ let result = <& SolverDelegate < ' tcx > >:: from ( infcx)
172+ . evaluate_root_goal ( goal, GenerateProofTree :: No )
173+ . 0 ;
169174 self . inspect_evaluated_obligation ( infcx, & obligation, & result) ;
170175 let ( changed, certainty) = match result {
171176 Ok ( result) => result,
@@ -288,7 +293,10 @@ fn fulfillment_error_for_stalled<'tcx>(
288293 root_obligation : PredicateObligation < ' tcx > ,
289294) -> FulfillmentError < ' tcx > {
290295 let ( code, refine_obligation) = infcx. probe ( |_| {
291- match infcx. evaluate_root_goal ( root_obligation. clone ( ) . into ( ) , GenerateProofTree :: No ) . 0 {
296+ match <& SolverDelegate < ' tcx > >:: from ( infcx)
297+ . evaluate_root_goal ( root_obligation. clone ( ) . into ( ) , GenerateProofTree :: No )
298+ . 0
299+ {
292300 Ok ( ( _, Certainty :: Maybe ( MaybeCause :: Ambiguity ) ) ) => {
293301 ( FulfillmentErrorCode :: Ambiguity { overflow : None } , true )
294302 }
0 commit comments