@@ -3,7 +3,7 @@ use rustc_data_structures::obligation_forest::ProcessResult;
33use rustc_data_structures:: obligation_forest:: { DoCompleted , Error , ForestObligation } ;
44use rustc_data_structures:: obligation_forest:: { ObligationForest , ObligationProcessor } ;
55use rustc_errors:: ErrorReported ;
6- use rustc_infer:: traits:: { PolyTraitObligation , TraitEngine , TraitEngineExt as _} ;
6+ use rustc_infer:: traits:: { TraitObligation , TraitEngine , TraitEngineExt as _} ;
77use rustc_middle:: mir:: interpret:: ErrorHandled ;
88use rustc_middle:: ty:: error:: ExpectedFound ;
99use rustc_middle:: ty:: ToPredicate ;
@@ -320,41 +320,40 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
320320 let infcx = self . selcx . infcx ( ) ;
321321
322322 match obligation. predicate . kind ( ) {
323- ty:: PredicateKind :: ForAll ( binder) => match binder. skip_binder ( ) . kind ( ) {
324- ty:: PredicateKind :: ForAll ( _) => bug ! ( "unexpected forall" ) ,
323+ ty:: PredicateKind :: ForAll ( binder) => match binder. skip_binder ( ) {
325324 // Evaluation will discard candidates using the leak check.
326325 // This means we need to pass it the bound version of our
327326 // predicate.
328- & ty:: PredicateKind :: Atom ( atom) => match atom {
329- ty:: PredicateAtom :: Trait ( trait_ref, _constness) => {
330- let trait_obligation = obligation. with ( Binder :: bind ( trait_ref) ) ;
331-
332- self . process_trait_obligation (
333- obligation,
334- trait_obligation,
335- & mut pending_obligation. stalled_on ,
336- )
337- }
338- ty:: PredicateAtom :: Projection ( projection) => {
339- let project_obligation = obligation. with ( Binder :: bind ( projection) ) ;
327+ ty:: PredicateAtom :: Trait ( trait_ref, _constness) => {
328+ let trait_obligation = obligation. with ( Binder :: bind ( trait_ref) ) ;
340329
341- self . process_projection_obligation (
342- project_obligation,
343- & mut pending_obligation. stalled_on ,
344- )
345- }
346- ty:: PredicateAtom :: RegionOutlives ( _)
347- | ty:: PredicateAtom :: TypeOutlives ( _)
348- | ty:: PredicateAtom :: WellFormed ( _)
349- | ty:: PredicateAtom :: ObjectSafe ( _)
350- | ty:: PredicateAtom :: ClosureKind ( ..)
351- | ty:: PredicateAtom :: Subtype ( _)
352- | ty:: PredicateAtom :: ConstEvaluatable ( ..)
353- | ty:: PredicateAtom :: ConstEquate ( ..) => {
354- let ( pred, _) = infcx. replace_bound_vars_with_placeholders ( binder) ;
355- ProcessResult :: Changed ( mk_pending ( vec ! [ obligation. with( pred) ] ) )
356- }
357- } ,
330+ self . process_trait_obligation (
331+ obligation,
332+ trait_obligation,
333+ & mut pending_obligation. stalled_on ,
334+ )
335+ }
336+ ty:: PredicateAtom :: Projection ( data) => {
337+ let project_obligation = obligation. with ( Binder :: bind ( data) ) ;
338+
339+ self . process_projection_obligation (
340+ project_obligation,
341+ & mut pending_obligation. stalled_on ,
342+ )
343+ }
344+ ty:: PredicateAtom :: RegionOutlives ( _)
345+ | ty:: PredicateAtom :: TypeOutlives ( _)
346+ | ty:: PredicateAtom :: WellFormed ( _)
347+ | ty:: PredicateAtom :: ObjectSafe ( _)
348+ | ty:: PredicateAtom :: ClosureKind ( ..)
349+ | ty:: PredicateAtom :: Subtype ( _)
350+ | ty:: PredicateAtom :: ConstEvaluatable ( ..)
351+ | ty:: PredicateAtom :: ConstEquate ( ..) => {
352+ let ( pred, _) = infcx. replace_bound_vars_with_placeholders ( binder) ;
353+ ProcessResult :: Changed ( mk_pending ( vec ! [
354+ obligation. with( pred. to_predicate( self . selcx. tcx( ) ) ) ,
355+ ] ) )
356+ }
358357 } ,
359358 & ty:: PredicateKind :: Atom ( atom) => match atom {
360359 ty:: PredicateAtom :: Trait ( ref data, _) => {
@@ -560,7 +559,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
560559 fn process_trait_obligation (
561560 & mut self ,
562561 obligation : & PredicateObligation < ' tcx > ,
563- trait_obligation : PolyTraitObligation < ' tcx > ,
562+ trait_obligation : TraitObligation < ' tcx > ,
564563 stalled_on : & mut Vec < TyOrConstInferVar < ' tcx > > ,
565564 ) -> ProcessResult < PendingPredicateObligation < ' tcx > , FulfillmentErrorCode < ' tcx > > {
566565 let infcx = self . selcx . infcx ( ) ;
0 commit comments