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 @@ -402,9 +402,7 @@ pub fn fully_solve_obligation<'tcx>(
402
402
infcx : & InferCtxt < ' tcx > ,
403
403
obligation : PredicateObligation < ' tcx > ,
404
404
) -> Vec < FulfillmentError < ' tcx > > {
405
- let ocx = ObligationCtxt :: new ( infcx) ;
406
- ocx. register_obligation ( obligation) ;
407
- ocx. select_all_or_error ( )
405
+ fully_solve_obligations ( infcx, [ obligation] )
408
406
}
409
407
410
408
/// Process a set of obligations (and any nested obligations that come from them)
@@ -428,9 +426,16 @@ pub fn fully_solve_bound<'tcx>(
428
426
ty : Ty < ' tcx > ,
429
427
bound : DefId ,
430
428
) -> Vec < FulfillmentError < ' tcx > > {
431
- let ocx = ObligationCtxt :: new ( infcx) ;
432
- ocx. register_bound ( cause, param_env, ty, bound) ;
433
- ocx. select_all_or_error ( )
429
+ let tcx = infcx. tcx ;
430
+ let trait_ref = ty:: TraitRef { def_id : bound, substs : tcx. mk_substs_trait ( ty, [ ] ) } ;
431
+ let obligation = Obligation {
432
+ cause,
433
+ recursion_depth : 0 ,
434
+ param_env,
435
+ predicate : ty:: Binder :: dummy ( trait_ref) . without_const ( ) . to_predicate ( tcx) ,
436
+ } ;
437
+
438
+ fully_solve_obligation ( infcx, obligation)
434
439
}
435
440
436
441
/// 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