Skip to content

Commit d47b7bb

Browse files
Appease the tools: clippy, rustdoc
1 parent f90e8ef commit d47b7bb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clippy_lints/src/len_zero.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use rustc_hir::def::Res;
88
use rustc_hir::def_id::{DefId, DefIdSet};
99
use 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
};
1414
use rustc_lint::{LateContext, LateLintPass};
1515
use 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

Comments
 (0)