@@ -712,7 +712,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
712712 if let Some ( result) = self . check_evaluation_cache (
713713 obligation. param_env ,
714714 fresh_trait_ref,
715- obligation. predicate . skip_binder ( ) . polarity ,
715+ obligation. polarity ( ) ,
716716 ) {
717717 debug ! ( ?result, "CACHE HIT" ) ;
718718 return Ok ( result) ;
@@ -746,7 +746,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
746746 self . insert_evaluation_cache (
747747 obligation. param_env ,
748748 fresh_trait_ref,
749- obligation. predicate . skip_binder ( ) . polarity ,
749+ obligation. polarity ( ) ,
750750 dep_node,
751751 result,
752752 ) ;
@@ -755,7 +755,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
755755 self . insert_evaluation_cache (
756756 obligation. param_env ,
757757 fresh_trait_ref,
758- obligation. predicate . skip_binder ( ) . polarity ,
758+ obligation. polarity ( ) ,
759759 dep_node,
760760 provisional_result. max ( result) ,
761761 ) ;
@@ -867,7 +867,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
867867 let unbound_input_types =
868868 stack. fresh_trait_ref . value . skip_binder ( ) . substs . types ( ) . any ( |ty| ty. is_fresh ( ) ) ;
869869
870- if stack. obligation . predicate . skip_binder ( ) . polarity != ty:: ImplPolarity :: Negative {
870+ if stack. obligation . polarity ( ) != ty:: ImplPolarity :: Negative {
871871 // This check was an imperfect workaround for a bug in the old
872872 // intercrate mode; it should be removed when that goes away.
873873 if unbound_input_types && self . intercrate {
@@ -1130,8 +1130,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11301130 if let ImplCandidate ( def_id) = candidate {
11311131 ty:: ImplPolarity :: Reservation == tcx. impl_polarity ( * def_id)
11321132 || !self . allow_negative_impls
1133- && stack. obligation . predicate . skip_binder ( ) . polarity
1134- == tcx. impl_polarity ( * def_id)
1133+ && stack. obligation . polarity ( ) == tcx. impl_polarity ( * def_id)
11351134 } else {
11361135 true
11371136 }
@@ -1199,9 +1198,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11991198 fn is_knowable < ' o > ( & mut self , stack : & TraitObligationStack < ' o , ' tcx > ) -> Option < Conflict > {
12001199 debug ! ( "is_knowable(intercrate={:?})" , self . intercrate) ;
12011200
1202- if !self . intercrate
1203- || stack. obligation . predicate . skip_binder ( ) . polarity == ty:: ImplPolarity :: Negative
1204- {
1201+ if !self . intercrate || stack. obligation . polarity ( ) == ty:: ImplPolarity :: Negative {
12051202 return None ;
12061203 }
12071204
0 commit comments