diff options
| author | Michael Goulet <michael@errs.io> | 2023-11-28 00:59:51 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-12-15 16:17:27 +0000 |
| commit | d47b7bb7aa1d152dca81a47c50ecddc61435ffe9 (patch) | |
| tree | ddc3be1868fb946f8291015b9e798e942dd59fdf | |
| parent | f90e8ef6b82574a7ed41e2f3abcc157b93411cf4 (diff) | |
| download | rust-d47b7bb7aa1d152dca81a47c50ecddc61435ffe9.tar.gz rust-d47b7bb7aa1d152dca81a47c50ecddc61435ffe9.zip | |
Appease the tools: clippy, rustdoc
| -rw-r--r-- | clippy_lints/src/len_zero.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clippy_lints/src/len_zero.rs b/clippy_lints/src/len_zero.rs index 83af551fcd3..8c032b17023 100644 --- a/clippy_lints/src/len_zero.rs +++ b/clippy_lints/src/len_zero.rs @@ -8,8 +8,8 @@ use rustc_hir::def::Res; use rustc_hir::def_id::{DefId, DefIdSet}; use rustc_hir::{ AssocItemKind, BinOpKind, Expr, ExprKind, FnRetTy, GenericArg, GenericBound, ImplItem, ImplItemKind, - ImplicitSelfKind, Item, ItemKind, LangItem, Mutability, Node, PatKind, PathSegment, PrimTy, QPath, TraitItemRef, - TyKind, TypeBindingKind, + ImplicitSelfKind, Item, ItemKind, Mutability, Node, PatKind, PathSegment, PrimTy, QPath, TraitItemRef, + TyKind, TypeBindingKind, OpaqueTyOrigin, }; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{self, AssocKind, FnSig, Ty}; @@ -289,8 +289,10 @@ fn extract_future_output<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<& kind: ItemKind::OpaqueTy(opaque), .. } = item - && opaque.bounds.len() == 1 - && let GenericBound::LangItemTrait(LangItem::Future, _, _, generic_args) = &opaque.bounds[0] + && let OpaqueTyOrigin::AsyncFn(_) = opaque.origin + && let [GenericBound::Trait(trait_ref, _)] = &opaque.bounds + && let Some(segment) = trait_ref.trait_ref.path.segments.last() + && let Some(generic_args) = segment.args && generic_args.bindings.len() == 1 && let TypeBindingKind::Equality { term: |
