@@ -23,7 +23,8 @@ use super::{DOUBLE_MUST_USE, MUST_USE_CANDIDATE, MUST_USE_UNIT};
23
23
pub ( super ) fn check_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: Item < ' _ > ) {
24
24
let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
25
25
let attr = cx. tcx . get_attr ( item. owner_id , sym:: must_use) ;
26
- if let hir:: ItemKind :: Fn ( ref sig, _generics, ref body_id) = item. kind {
26
+ if let hir:: ItemKind :: Fn ( ref sig, _generics, ref body_id) = item. kind && !sig. header . is_async ( ) /* (#10486) */ {
27
+
27
28
let is_public = cx. effective_visibilities . is_exported ( item. owner_id . def_id ) ;
28
29
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
29
30
if let Some ( attr) = attr {
@@ -43,7 +44,7 @@ pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>
43
44
}
44
45
45
46
pub ( super ) fn check_impl_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: ImplItem < ' _ > ) {
46
- if let hir:: ImplItemKind :: Fn ( ref sig, ref body_id) = item. kind {
47
+ if let hir:: ImplItemKind :: Fn ( ref sig, ref body_id) = item. kind && !sig . header . is_async ( ) /* (#10486) */ {
47
48
let is_public = cx. effective_visibilities . is_exported ( item. owner_id . def_id ) ;
48
49
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
49
50
let attrs = cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) ;
@@ -65,7 +66,7 @@ pub(super) fn check_impl_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Imp
65
66
}
66
67
67
68
pub ( super ) fn check_trait_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: TraitItem < ' _ > ) {
68
- if let hir:: TraitItemKind :: Fn ( ref sig, ref eid) = item. kind {
69
+ if let hir:: TraitItemKind :: Fn ( ref sig, ref eid) = item. kind && !sig . header . is_async ( ) /* (#10486) */ {
69
70
let is_public = cx. effective_visibilities . is_exported ( item. owner_id . def_id ) ;
70
71
let fn_header_span = item. span . with_hi ( sig. decl . output . span ( ) . hi ( ) ) ;
71
72
0 commit comments