@@ -8,8 +8,8 @@ use rustc_hir::def::Res;
8
8
use rustc_hir:: def_id:: { DefId , DefIdSet } ;
9
9
use rustc_hir:: {
10
10
AssocItemKind , BinOpKind , Expr , ExprKind , FnRetTy , GenericArg , GenericBound , ImplItem , ImplItemKind ,
11
- ImplicitSelfKind , Item , ItemKind , LangItem , Mutability , Node , PatKind , PathSegment , PrimTy , QPath , TraitItemRef ,
12
- TyKind , TypeBindingKind ,
11
+ ImplicitSelfKind , Item , ItemKind , Mutability , Node , PatKind , PathSegment , PrimTy , QPath , TraitItemRef ,
12
+ TyKind , TypeBindingKind , OpaqueTyOrigin ,
13
13
} ;
14
14
use rustc_lint:: { LateContext , LateLintPass } ;
15
15
use rustc_middle:: ty:: { self , AssocKind , FnSig , Ty } ;
@@ -289,8 +289,10 @@ fn extract_future_output<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<&
289
289
kind : ItemKind :: OpaqueTy ( opaque) ,
290
290
..
291
291
} = item
292
- && opaque. bounds . len ( ) == 1
293
- && let GenericBound :: LangItemTrait ( LangItem :: Future , _, _, generic_args) = & opaque. bounds [ 0 ]
292
+ && let OpaqueTyOrigin :: AsyncFn ( _) = opaque. origin
293
+ && let [ GenericBound :: Trait ( trait_ref, _) ] = & opaque. bounds
294
+ && let Some ( segment) = trait_ref. trait_ref . path . segments . last ( )
295
+ && let Some ( generic_args) = segment. args
294
296
&& generic_args. bindings . len ( ) == 1
295
297
&& let TypeBindingKind :: Equality {
296
298
term :
0 commit comments