File tree 1 file changed +11
-6
lines changed
compiler/rustc_trait_selection/src/traits
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -394,9 +394,7 @@ pub fn fully_solve_obligation<'tcx>(
394
394
infcx : & InferCtxt < ' tcx > ,
395
395
obligation : PredicateObligation < ' tcx > ,
396
396
) -> Vec < FulfillmentError < ' tcx > > {
397
- let ocx = ObligationCtxt :: new ( infcx) ;
398
- ocx. register_obligation ( obligation) ;
399
- ocx. select_all_or_error ( )
397
+ fully_solve_obligations ( infcx, [ obligation] )
400
398
}
401
399
402
400
/// Process a set of obligations (and any nested obligations that come from them)
@@ -420,9 +418,16 @@ pub fn fully_solve_bound<'tcx>(
420
418
ty : Ty < ' tcx > ,
421
419
bound : DefId ,
422
420
) -> Vec < FulfillmentError < ' tcx > > {
423
- let ocx = ObligationCtxt :: new ( infcx) ;
424
- ocx. register_bound ( cause, param_env, ty, bound) ;
425
- ocx. select_all_or_error ( )
421
+ let tcx = infcx. tcx ;
422
+ let trait_ref = ty:: TraitRef { def_id : bound, substs : tcx. mk_substs_trait ( ty, & [ ] ) } ;
423
+ let obligation = Obligation {
424
+ cause,
425
+ recursion_depth : 0 ,
426
+ param_env,
427
+ predicate : ty:: Binder :: dummy ( trait_ref) . without_const ( ) . to_predicate ( tcx) ,
428
+ } ;
429
+
430
+ fully_solve_obligation ( infcx, obligation)
426
431
}
427
432
428
433
/// Normalizes the predicates and checks whether they hold in an empty environment. If this
You can’t perform that action at this time.
0 commit comments