@@ -4,7 +4,7 @@ use rustc_errors::Applicability;
44use rustc_hir:: intravisit:: FnKind ;
55use rustc_hir:: {
66 Block , Body , Closure , ClosureKind , CoroutineDesugaring , CoroutineKind , CoroutineSource , Expr , ExprKind , FnDecl ,
7- FnRetTy , GenericArg , GenericBound , ImplItem , Item , ItemKind , LifetimeName , Node , TraitRef , Ty , TyKind ,
7+ FnRetTy , GenericArg , GenericBound , ImplItem , Item , LifetimeName , Node , TraitRef , Ty , TyKind ,
88} ;
99use rustc_lint:: { LateContext , LateLintPass } ;
1010use rustc_session:: declare_lint_pass;
@@ -105,9 +105,8 @@ fn future_trait_ref<'tcx>(
105105 cx : & LateContext < ' tcx > ,
106106 ty : & ' tcx Ty < ' tcx > ,
107107) -> Option < ( & ' tcx TraitRef < ' tcx > , Vec < LifetimeName > ) > {
108- if let TyKind :: OpaqueDef ( item_id, bounds, false ) = ty. kind
109- && let item = cx. tcx . hir ( ) . item ( item_id)
110- && let ItemKind :: OpaqueTy ( opaque) = & item. kind
108+ if let TyKind :: OpaqueDef ( opaque, bounds) = ty. kind
109+ && !opaque. in_trait
111110 && let Some ( trait_ref) = opaque. bounds . iter ( ) . find_map ( |bound| {
112111 if let GenericBound :: Trait ( poly, _) = bound {
113112 Some ( & poly. trait_ref )
0 commit comments