use rustc_hir::intravisit::FnKind;
use rustc_hir::{
AsyncGeneratorKind, Block, Body, Closure, Expr, ExprKind, FnDecl, FnRetTy, GeneratorKind, GenericArg, GenericBound,
- HirId, IsAsync, ItemKind, LifetimeName, Term, TraitRef, Ty, TyKind, TypeBindingKind,
+ HirId, ItemKind, LifetimeName, Term, TraitRef, Ty, TyKind, TypeBindingKind,
};
use rustc_lint::{LateContext, LateLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
) {
if_chain! {
if let Some(header) = kind.header();
- if header.asyncness == IsAsync::NotAsync;
+ if !header.asyncness.is_async();
// Check that this function returns `impl Future`
if let FnRetTy::Return(ret_ty) = decl.output;
if let Some((trait_ref, output_lifetimes)) = future_trait_ref(cx, ret_ty);
.iter()
.filter_map(|bound| {
if let GenericArg::Lifetime(lt) = bound {
- Some(lt.name)
+ Some(lt.res)
} else {
None
}
.iter()
.filter_map(|ty| {
if let TyKind::Rptr(lt, _) = ty.kind {
- Some(lt.name)
+ Some(lt.res)
} else {
None
}
if let Some(args) = cx
.tcx
.lang_items()
- .from_generator_fn()
+ .identity_future_fn()
.and_then(|def_id| match_function_call_with_def_id(cx, block_expr, def_id));
if args.len() == 1;
if let Expr {