@@ -4,7 +4,7 @@ use rustc_hir::def_id::DefId;
4
4
use rustc_hir:: { Expr , ExprKind , StmtKind } ;
5
5
use rustc_lint:: { LateContext , LateLintPass } ;
6
6
use rustc_middle:: ty;
7
- use rustc_middle:: ty:: { GenericPredicates , PredicateKind , ProjectionPredicate , TraitPredicate } ;
7
+ use rustc_middle:: ty:: { GenericPredicates , PredicateAtom , ProjectionPredicate , TraitPredicate } ;
8
8
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
9
9
use rustc_span:: { BytePos , Span } ;
10
10
@@ -42,8 +42,8 @@ fn get_trait_predicates_for_trait_id<'tcx>(
42
42
let mut preds = Vec :: new ( ) ;
43
43
for ( pred, _) in generics. predicates {
44
44
if_chain ! {
45
- if let PredicateKind :: Trait ( poly_trait_pred, _) = pred. kind ( ) ;
46
- let trait_pred = cx. tcx. erase_late_bound_regions( & poly_trait_pred) ;
45
+ if let PredicateAtom :: Trait ( poly_trait_pred, _) = pred. skip_binders ( ) ;
46
+ let trait_pred = cx. tcx. erase_late_bound_regions( & ty :: Binder :: bind ( poly_trait_pred) ) ;
47
47
if let Some ( trait_def_id) = trait_id;
48
48
if trait_def_id == trait_pred. trait_ref. def_id;
49
49
then {
@@ -60,8 +60,8 @@ fn get_projection_pred<'tcx>(
60
60
pred : TraitPredicate < ' tcx > ,
61
61
) -> Option < ProjectionPredicate < ' tcx > > {
62
62
generics. predicates . iter ( ) . find_map ( |( proj_pred, _) | {
63
- if let PredicateKind :: Projection ( proj_pred) = proj_pred. kind ( ) {
64
- let projection_pred = cx. tcx . erase_late_bound_regions ( proj_pred) ;
63
+ if let ty :: PredicateAtom :: Projection ( proj_pred) = proj_pred. skip_binders ( ) {
64
+ let projection_pred = cx. tcx . erase_late_bound_regions ( & ty :: Binder :: bind ( proj_pred) ) ;
65
65
if projection_pred. projection_ty . substs == pred. trait_ref . substs {
66
66
return Some ( projection_pred) ;
67
67
}
0 commit comments