@@ -712,7 +712,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
712
712
if let Some ( result) = self . check_evaluation_cache (
713
713
obligation. param_env ,
714
714
fresh_trait_ref,
715
- obligation. predicate . skip_binder ( ) . polarity ,
715
+ obligation. polarity ( ) ,
716
716
) {
717
717
debug ! ( ?result, "CACHE HIT" ) ;
718
718
return Ok ( result) ;
@@ -746,7 +746,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
746
746
self . insert_evaluation_cache (
747
747
obligation. param_env ,
748
748
fresh_trait_ref,
749
- obligation. predicate . skip_binder ( ) . polarity ,
749
+ obligation. polarity ( ) ,
750
750
dep_node,
751
751
result,
752
752
) ;
@@ -755,7 +755,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
755
755
self . insert_evaluation_cache (
756
756
obligation. param_env ,
757
757
fresh_trait_ref,
758
- obligation. predicate . skip_binder ( ) . polarity ,
758
+ obligation. polarity ( ) ,
759
759
dep_node,
760
760
provisional_result. max ( result) ,
761
761
) ;
@@ -867,7 +867,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
867
867
let unbound_input_types =
868
868
stack. fresh_trait_ref . value . skip_binder ( ) . substs . types ( ) . any ( |ty| ty. is_fresh ( ) ) ;
869
869
870
- if stack. obligation . predicate . skip_binder ( ) . polarity != ty:: ImplPolarity :: Negative {
870
+ if stack. obligation . polarity ( ) != ty:: ImplPolarity :: Negative {
871
871
// This check was an imperfect workaround for a bug in the old
872
872
// intercrate mode; it should be removed when that goes away.
873
873
if unbound_input_types && self . intercrate {
@@ -1130,8 +1130,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1130
1130
if let ImplCandidate ( def_id) = candidate {
1131
1131
ty:: ImplPolarity :: Reservation == tcx. impl_polarity ( * def_id)
1132
1132
|| !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)
1135
1134
} else {
1136
1135
true
1137
1136
}
@@ -1199,9 +1198,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1199
1198
fn is_knowable < ' o > ( & mut self , stack : & TraitObligationStack < ' o , ' tcx > ) -> Option < Conflict > {
1200
1199
debug ! ( "is_knowable(intercrate={:?})" , self . intercrate) ;
1201
1200
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 {
1205
1202
return None ;
1206
1203
}
1207
1204
0 commit comments