@@ -255,7 +255,12 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
255
255
return ;
256
256
}
257
257
258
- match obligation. predicate . ignore_qualifiers ( tcx) . skip_binder ( ) . kind ( ) {
258
+ match obligation
259
+ . predicate
260
+ . ignore_qualifiers_with_unbound_vars ( tcx)
261
+ . skip_binder ( )
262
+ . kind ( )
263
+ {
259
264
ty:: PredicateKind :: ForAll ( _) => {
260
265
bug ! ( "unexpected predicate: {:?}" , obligation. predicate)
261
266
}
@@ -1065,8 +1070,8 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
1065
1070
1066
1071
// FIXME: It should be possible to deal with `ForAll` in a cleaner way.
1067
1072
let ( cond, error) = match (
1068
- cond. ignore_qualifiers ( self . tcx ) . skip_binder ( ) . kind ( ) ,
1069
- error. ignore_qualifiers ( self . tcx ) . skip_binder ( ) . kind ( ) ,
1073
+ cond. ignore_qualifiers_with_unbound_vars ( self . tcx ) . skip_binder ( ) . kind ( ) ,
1074
+ error. ignore_qualifiers_with_unbound_vars ( self . tcx ) . skip_binder ( ) . kind ( ) ,
1070
1075
) {
1071
1076
( ty:: PredicateKind :: Trait ( ..) , & ty:: PredicateKind :: Trait ( error, _) ) => {
1072
1077
( cond, ty:: Binder :: bind ( error) )
@@ -1078,8 +1083,11 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
1078
1083
} ;
1079
1084
1080
1085
for obligation in super :: elaborate_predicates ( self . tcx , std:: iter:: once ( cond) ) {
1081
- if let & ty:: PredicateKind :: Trait ( implication, _) =
1082
- obligation. predicate . ignore_qualifiers ( self . tcx ) . skip_binder ( ) . kind ( )
1086
+ if let & ty:: PredicateKind :: Trait ( implication, _) = obligation
1087
+ . predicate
1088
+ . ignore_qualifiers_with_unbound_vars ( self . tcx )
1089
+ . skip_binder ( )
1090
+ . kind ( )
1083
1091
{
1084
1092
let error = error. to_poly_trait_ref ( ) ;
1085
1093
let implication = ty:: Binder :: bind ( implication) . to_poly_trait_ref ( ) ;
@@ -1161,7 +1169,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
1161
1169
// this can fail if the problem was higher-ranked, in which
1162
1170
// cause I have no idea for a good error message.
1163
1171
if let & ty:: PredicateKind :: Projection ( data) =
1164
- predicate. ignore_qualifiers ( self . tcx ) . skip_binder ( ) . kind ( )
1172
+ predicate. ignore_qualifiers_with_unbound_vars ( self . tcx ) . skip_binder ( ) . kind ( )
1165
1173
{
1166
1174
let mut selcx = SelectionContext :: new ( self ) ;
1167
1175
let ( data, _) = self . replace_bound_vars_with_fresh_vars (
@@ -1454,7 +1462,11 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
1454
1462
return ;
1455
1463
}
1456
1464
1457
- let mut err = match predicate. ignore_qualifiers ( self . tcx ) . skip_binder ( ) . kind ( ) {
1465
+ let mut err = match predicate
1466
+ . ignore_qualifiers_with_unbound_vars ( self . tcx )
1467
+ . skip_binder ( )
1468
+ . kind ( )
1469
+ {
1458
1470
& ty:: PredicateKind :: Trait ( data, _) => {
1459
1471
let trait_ref = ty:: Binder :: bind ( data. trait_ref ) ;
1460
1472
let self_ty = trait_ref. skip_binder ( ) . self_ty ( ) ;
@@ -1708,7 +1720,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
1708
1720
obligation : & PredicateObligation < ' tcx > ,
1709
1721
) {
1710
1722
let ( pred, item_def_id, span) = match (
1711
- obligation. predicate . ignore_qualifiers ( self . tcx ) . skip_binder ( ) . kind ( ) ,
1723
+ obligation. predicate . ignore_qualifiers_with_unbound_vars ( self . tcx ) . skip_binder ( ) . kind ( ) ,
1712
1724
obligation. cause . code . peel_derives ( ) ,
1713
1725
) {
1714
1726
(
0 commit comments