@@ -58,14 +58,15 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
5858 let f = parse_macro_input ! ( input as ItemFn ) ;
5959
6060 // check the function signature
61- let valid_signature = f. constness . is_none ( )
61+ let valid_signature = f. sig . constness . is_none ( )
62+ && f. sig . asyncness . is_none ( )
6263 && f. vis == Visibility :: Inherited
63- && f. abi . is_none ( )
64- && f. decl . inputs . is_empty ( )
65- && f. decl . generics . params . is_empty ( )
66- && f. decl . generics . where_clause . is_none ( )
67- && f. decl . variadic . is_none ( )
68- && match f. decl . output {
64+ && f. sig . abi . is_none ( )
65+ && f. sig . inputs . is_empty ( )
66+ && f. sig . generics . params . is_empty ( )
67+ && f. sig . generics . where_clause . is_none ( )
68+ && f. sig . variadic . is_none ( )
69+ && match f. sig . output {
6970 ReturnType :: Default => false ,
7071 ReturnType :: Type ( _, ref ty) => match * * ty {
7172 Type :: Never ( _) => true ,
@@ -90,7 +91,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
9091
9192 // XXX should we blacklist other attributes?
9293 let attrs = f. attrs ;
93- let unsafety = f. unsafety ;
94+ let unsafety = f. sig . unsafety ;
9495 let hash = random_ident ( ) ;
9596 let stmts = f. block . stmts ;
9697
@@ -133,15 +134,16 @@ pub fn pre_init(args: TokenStream, input: TokenStream) -> TokenStream {
133134 let f = parse_macro_input ! ( input as ItemFn ) ;
134135
135136 // check the function signature
136- let valid_signature = f. constness . is_none ( )
137+ let valid_signature = f. sig . constness . is_none ( )
138+ && f. sig . asyncness . is_none ( )
137139 && f. vis == Visibility :: Inherited
138- && f. unsafety . is_some ( )
139- && f. abi . is_none ( )
140- && f. decl . inputs . is_empty ( )
141- && f. decl . generics . params . is_empty ( )
142- && f. decl . generics . where_clause . is_none ( )
143- && f. decl . variadic . is_none ( )
144- && match f. decl . output {
140+ && f. sig . unsafety . is_some ( )
141+ && f. sig . abi . is_none ( )
142+ && f. sig . inputs . is_empty ( )
143+ && f. sig . generics . params . is_empty ( )
144+ && f. sig . generics . where_clause . is_none ( )
145+ && f. sig . variadic . is_none ( )
146+ && match f. sig . output {
145147 ReturnType :: Default => true ,
146148 ReturnType :: Type ( _, ref ty) => match * * ty {
147149 Type :: Tuple ( ref tuple) => tuple. elems . is_empty ( ) ,
@@ -166,7 +168,7 @@ pub fn pre_init(args: TokenStream, input: TokenStream) -> TokenStream {
166168
167169 // XXX should we blacklist other attributes?
168170 let attrs = f. attrs ;
169- let ident = f. ident ;
171+ let ident = f. sig . ident ;
170172 let block = f. block ;
171173
172174 quote ! (
0 commit comments