@@ -345,48 +345,48 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
345345
346346 let infcx = self . selcx . infcx ( ) ;
347347
348- match * obligation. predicate . kind ( ) {
349- ty:: PredicateKind :: ForAll ( binder) if binder. skip_binder ( ) . has_escaping_bound_vars ( ) => {
350- match binder. skip_binder ( ) {
351- // Evaluation will discard candidates using the leak check.
352- // This means we need to pass it the bound version of our
353- // predicate.
354- ty:: PredicateAtom :: Trait ( trait_ref, _constness) => {
355- let trait_obligation = obligation. with ( binder. rebind ( trait_ref) ) ;
356-
357- self . process_trait_obligation (
358- obligation,
359- trait_obligation,
360- & mut pending_obligation. stalled_on ,
361- )
362- }
363- ty:: PredicateAtom :: Projection ( data) => {
364- let project_obligation = obligation. with ( binder. rebind ( data) ) ;
348+ let ty:: PredicateKind :: ForAll ( binder) = * obligation. predicate . kind ( ) ;
349+ if binder. skip_binder ( ) . has_escaping_bound_vars ( ) {
350+ match binder. skip_binder ( ) {
351+ // Evaluation will discard candidates using the leak check.
352+ // This means we need to pass it the bound version of our
353+ // predicate.
354+ ty:: PredicateAtom :: Trait ( trait_ref, _constness) => {
355+ let trait_obligation = obligation. with ( binder. rebind ( trait_ref) ) ;
365356
366- self . process_projection_obligation (
367- project_obligation,
368- & mut pending_obligation. stalled_on ,
369- )
370- }
371- ty:: PredicateAtom :: RegionOutlives ( _)
372- | ty:: PredicateAtom :: TypeOutlives ( _)
373- | ty:: PredicateAtom :: WellFormed ( _)
374- | ty:: PredicateAtom :: ObjectSafe ( _)
375- | ty:: PredicateAtom :: ClosureKind ( ..)
376- | ty:: PredicateAtom :: Subtype ( _)
377- | ty:: PredicateAtom :: ConstEvaluatable ( ..)
378- | ty:: PredicateAtom :: ConstEquate ( ..) => {
379- let pred = infcx. replace_bound_vars_with_placeholders ( binder) ;
380- ProcessResult :: Changed ( mk_pending ( vec ! [
381- obligation. with( pred. to_predicate( self . selcx. tcx( ) ) ) ,
382- ] ) )
383- }
384- ty:: PredicateAtom :: TypeWellFormedFromEnv ( ..) => {
385- bug ! ( "TypeWellFormedFromEnv is only used for Chalk" )
386- }
357+ self . process_trait_obligation (
358+ obligation,
359+ trait_obligation,
360+ & mut pending_obligation. stalled_on ,
361+ )
362+ }
363+ ty:: PredicateAtom :: Projection ( data) => {
364+ let project_obligation = obligation. with ( binder. rebind ( data) ) ;
365+
366+ self . process_projection_obligation (
367+ project_obligation,
368+ & mut pending_obligation. stalled_on ,
369+ )
370+ }
371+ ty:: PredicateAtom :: RegionOutlives ( _)
372+ | ty:: PredicateAtom :: TypeOutlives ( _)
373+ | ty:: PredicateAtom :: WellFormed ( _)
374+ | ty:: PredicateAtom :: ObjectSafe ( _)
375+ | ty:: PredicateAtom :: ClosureKind ( ..)
376+ | ty:: PredicateAtom :: Subtype ( _)
377+ | ty:: PredicateAtom :: ConstEvaluatable ( ..)
378+ | ty:: PredicateAtom :: ConstEquate ( ..) => {
379+ let pred = infcx. replace_bound_vars_with_placeholders ( binder) ;
380+ ProcessResult :: Changed ( mk_pending ( vec ! [
381+ obligation. with( pred. to_predicate( self . selcx. tcx( ) ) ) ,
382+ ] ) )
383+ }
384+ ty:: PredicateAtom :: TypeWellFormedFromEnv ( ..) => {
385+ bug ! ( "TypeWellFormedFromEnv is only used for Chalk" )
387386 }
388387 }
389- ty:: PredicateKind :: ForAll ( binder) => match binder. skip_binder ( ) {
388+ } else {
389+ match binder. skip_binder ( ) {
390390 ty:: PredicateAtom :: Trait ( data, _) => {
391391 let trait_obligation = obligation. with ( Binder :: dummy ( data) ) ;
392392
@@ -598,7 +598,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
598598 ty:: PredicateAtom :: TypeWellFormedFromEnv ( ..) => {
599599 bug ! ( "TypeWellFormedFromEnv is only used for Chalk" )
600600 }
601- } ,
601+ }
602602 }
603603 }
604604
0 commit comments