@@ -10,7 +10,7 @@ use rustc_middle::ty::error::{ExpectedFound, TypeError};
1010use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
1111use rustc_middle:: { bug, span_bug} ;
1212use rustc_next_trait_solver:: solve:: { GenerateProofTree , SolverDelegateEvalExt as _} ;
13- use rustc_type_ir:: solve:: { Goal , NoSolution } ;
13+ use rustc_type_ir:: solve:: NoSolution ;
1414use tracing:: { instrument, trace} ;
1515
1616use crate :: solve:: Certainty ;
@@ -89,7 +89,7 @@ pub(super) fn fulfillment_error_for_stalled<'tcx>(
8989 let ( code, refine_obligation) = infcx. probe ( |_| {
9090 match <& SolverDelegate < ' tcx > >:: from ( infcx)
9191 . evaluate_root_goal (
92- root_obligation. clone ( ) . into ( ) ,
92+ root_obligation. as_goal ( ) ,
9393 GenerateProofTree :: No ,
9494 root_obligation. cause . span ,
9595 )
@@ -155,7 +155,7 @@ fn find_best_leaf_obligation<'tcx>(
155155 . fudge_inference_if_ok ( || {
156156 infcx
157157 . visit_proof_tree (
158- obligation. clone ( ) . into ( ) ,
158+ obligation. as_goal ( ) ,
159159 & mut BestObligation { obligation : obligation. clone ( ) , consider_ambiguities } ,
160160 )
161161 . break_value ( )
@@ -245,7 +245,7 @@ impl<'tcx> BestObligation<'tcx> {
245245 {
246246 let nested_goal = candidate. instantiate_proof_tree_for_nested_goal (
247247 GoalSource :: Misc ,
248- Goal :: new ( infcx . tcx , obligation. param_env , obligation . predicate ) ,
248+ obligation. as_goal ( ) ,
249249 self . span ( ) ,
250250 ) ;
251251 // Skip nested goals that aren't the *reason* for our goal's failure.
0 commit comments