@@ -4,7 +4,7 @@ use rustc_errors::Applicability;
4
4
use rustc_hir:: intravisit:: FnKind ;
5
5
use rustc_hir:: {
6
6
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 ,
8
8
} ;
9
9
use rustc_lint:: { LateContext , LateLintPass } ;
10
10
use rustc_session:: declare_lint_pass;
@@ -105,9 +105,8 @@ fn future_trait_ref<'tcx>(
105
105
cx : & LateContext < ' tcx > ,
106
106
ty : & ' tcx Ty < ' tcx > ,
107
107
) -> 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
111
110
&& let Some ( trait_ref) = opaque. bounds . iter ( ) . find_map ( |bound| {
112
111
if let GenericBound :: Trait ( poly, _) = bound {
113
112
Some ( & poly. trait_ref )
0 commit comments