@@ -4,7 +4,7 @@ use rustc_hir::intravisit::FnKind;
4
4
use rustc_hir:: { Body , FnDecl } ;
5
5
use rustc_infer:: infer:: TyCtxtInferExt ;
6
6
use rustc_lint:: { LateContext , LateLintPass } ;
7
- use rustc_middle:: ty:: { self , AliasTy , Clause , EarlyBinder , PredicateKind } ;
7
+ use rustc_middle:: ty:: { self , AliasTy , Clause , PredicateKind } ;
8
8
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
9
9
use rustc_span:: def_id:: LocalDefId ;
10
10
use rustc_span:: { sym, Span } ;
@@ -64,10 +64,9 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
64
64
}
65
65
let ret_ty = return_ty ( cx, cx. tcx . hir ( ) . local_def_id_to_hir_id ( fn_def_id) . expect_owner ( ) ) ;
66
66
if let ty:: Alias ( ty:: Opaque , AliasTy { def_id, substs, .. } ) = * ret_ty. kind ( ) {
67
- let preds = cx. tcx . explicit_item_bounds ( def_id) ;
67
+ let preds = cx. tcx . bound_explicit_item_bounds ( def_id) ;
68
68
let mut is_future = false ;
69
- for & ( p, _span) in preds {
70
- let p = EarlyBinder ( p) . subst ( cx. tcx , substs) ;
69
+ for ( p, _span) in preds. subst_iter_copied ( cx. tcx , substs) {
71
70
if let Some ( trait_pred) = p. to_opt_poly_trait_pred ( ) {
72
71
if Some ( trait_pred. skip_binder ( ) . trait_ref . def_id ) == cx. tcx . lang_items ( ) . future_trait ( ) {
73
72
is_future = true ;
0 commit comments