@@ -3,7 +3,7 @@ use rustc_data_structures::obligation_forest::ProcessResult;
3
3
use rustc_data_structures:: obligation_forest:: { DoCompleted , Error , ForestObligation } ;
4
4
use rustc_data_structures:: obligation_forest:: { ObligationForest , ObligationProcessor } ;
5
5
use rustc_errors:: ErrorReported ;
6
- use rustc_infer:: traits:: { PolyTraitObligation , TraitEngine , TraitEngineExt as _} ;
6
+ use rustc_infer:: traits:: { TraitObligation , TraitEngine , TraitEngineExt as _} ;
7
7
use rustc_middle:: mir:: interpret:: ErrorHandled ;
8
8
use rustc_middle:: ty:: error:: ExpectedFound ;
9
9
use rustc_middle:: ty:: ToPredicate ;
@@ -320,41 +320,40 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
320
320
let infcx = self . selcx . infcx ( ) ;
321
321
322
322
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 ( ) {
325
324
// Evaluation will discard candidates using the leak check.
326
325
// This means we need to pass it the bound version of our
327
326
// 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) ) ;
340
329
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
+ }
358
357
} ,
359
358
& ty:: PredicateKind :: Atom ( atom) => match atom {
360
359
ty:: PredicateAtom :: Trait ( ref data, _) => {
@@ -560,7 +559,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
560
559
fn process_trait_obligation (
561
560
& mut self ,
562
561
obligation : & PredicateObligation < ' tcx > ,
563
- trait_obligation : PolyTraitObligation < ' tcx > ,
562
+ trait_obligation : TraitObligation < ' tcx > ,
564
563
stalled_on : & mut Vec < TyOrConstInferVar < ' tcx > > ,
565
564
) -> ProcessResult < PendingPredicateObligation < ' tcx > , FulfillmentErrorCode < ' tcx > > {
566
565
let infcx = self . selcx . infcx ( ) ;
0 commit comments