@@ -8,8 +8,8 @@ use rustc_hir::def::Res;
88use rustc_hir:: def_id:: { DefId , DefIdSet } ;
99use rustc_hir:: {
1010 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 ,
1313} ;
1414use rustc_lint:: { LateContext , LateLintPass } ;
1515use rustc_middle:: ty:: { self , AssocKind , FnSig , Ty } ;
@@ -289,8 +289,10 @@ fn extract_future_output<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<&
289289 kind : ItemKind :: OpaqueTy ( opaque) ,
290290 ..
291291 } = 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
294296 && generic_args. bindings . len ( ) == 1
295297 && let TypeBindingKind :: Equality {
296298 term :
0 commit comments