@@ -10,7 +10,7 @@ use rustc_middle::ty::error::{ExpectedFound, TypeError};
10
10
use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
11
11
use rustc_middle:: { bug, span_bug} ;
12
12
use rustc_next_trait_solver:: solve:: { GenerateProofTree , SolverDelegateEvalExt as _} ;
13
- use rustc_type_ir:: solve:: { Goal , NoSolution } ;
13
+ use rustc_type_ir:: solve:: NoSolution ;
14
14
use tracing:: { instrument, trace} ;
15
15
16
16
use crate :: solve:: Certainty ;
@@ -89,7 +89,7 @@ pub(super) fn fulfillment_error_for_stalled<'tcx>(
89
89
let ( code, refine_obligation) = infcx. probe ( |_| {
90
90
match <& SolverDelegate < ' tcx > >:: from ( infcx)
91
91
. evaluate_root_goal (
92
- root_obligation. clone ( ) . into ( ) ,
92
+ root_obligation. as_goal ( ) ,
93
93
GenerateProofTree :: No ,
94
94
root_obligation. cause . span ,
95
95
)
@@ -155,7 +155,7 @@ fn find_best_leaf_obligation<'tcx>(
155
155
. fudge_inference_if_ok ( || {
156
156
infcx
157
157
. visit_proof_tree (
158
- obligation. clone ( ) . into ( ) ,
158
+ obligation. as_goal ( ) ,
159
159
& mut BestObligation { obligation : obligation. clone ( ) , consider_ambiguities } ,
160
160
)
161
161
. break_value ( )
@@ -245,7 +245,7 @@ impl<'tcx> BestObligation<'tcx> {
245
245
{
246
246
let nested_goal = candidate. instantiate_proof_tree_for_nested_goal (
247
247
GoalSource :: Misc ,
248
- Goal :: new ( infcx . tcx , obligation. param_env , obligation . predicate ) ,
248
+ obligation. as_goal ( ) ,
249
249
self . span ( ) ,
250
250
) ;
251
251
// Skip nested goals that aren't the *reason* for our goal's failure.
0 commit comments