@@ -98,7 +98,7 @@ use rustc_hir::def::{DefKind, Res};
9898use rustc_hir:: def_id:: { DefId , LocalDefId , LocalModDefId } ;
9999use rustc_hir:: definitions:: { DefPath , DefPathData } ;
100100use rustc_hir:: hir_id:: { HirIdMap , HirIdSet } ;
101- use rustc_hir:: intravisit:: { FnKind , Visitor , walk_expr} ;
101+ use rustc_hir:: intravisit:: { Visitor , walk_expr} ;
102102use rustc_hir:: {
103103 self as hir, Arm , BindingMode , Block , BlockCheckMode , Body , ByRef , Closure , ConstArgKind , CoroutineDesugaring ,
104104 CoroutineKind , CoroutineSource , Destination , Expr , ExprField , ExprKind , FnDecl , FnRetTy , GenericArg , GenericArgs ,
@@ -1854,15 +1854,6 @@ pub fn if_sequence<'tcx>(mut expr: &'tcx Expr<'tcx>) -> (Vec<&'tcx Expr<'tcx>>,
18541854 ( conds, blocks)
18551855}
18561856
1857- /// Checks if the given function kind is an async function.
1858- pub fn is_async_fn ( kind : FnKind < ' _ > ) -> bool {
1859- match kind {
1860- FnKind :: ItemFn ( _, _, header) => header. asyncness . is_async ( ) ,
1861- FnKind :: Method ( _, sig) => sig. header . asyncness . is_async ( ) ,
1862- FnKind :: Closure => false ,
1863- }
1864- }
1865-
18661857/// Peels away all the compiler generated code surrounding the body of an async closure.
18671858pub fn get_async_closure_expr < ' tcx > ( tcx : TyCtxt < ' tcx > , expr : & Expr < ' _ > ) -> Option < & ' tcx Expr < ' tcx > > {
18681859 if let ExprKind :: Closure ( & Closure {
0 commit comments