@@ -58,14 +58,15 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
58
58
let f = parse_macro_input ! ( input as ItemFn ) ;
59
59
60
60
// 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 ( )
62
63
&& 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 {
69
70
ReturnType :: Default => false ,
70
71
ReturnType :: Type ( _, ref ty) => match * * ty {
71
72
Type :: Never ( _) => true ,
@@ -90,7 +91,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
90
91
91
92
// XXX should we blacklist other attributes?
92
93
let attrs = f. attrs ;
93
- let unsafety = f. unsafety ;
94
+ let unsafety = f. sig . unsafety ;
94
95
let hash = random_ident ( ) ;
95
96
let stmts = f. block . stmts ;
96
97
@@ -133,15 +134,16 @@ pub fn pre_init(args: TokenStream, input: TokenStream) -> TokenStream {
133
134
let f = parse_macro_input ! ( input as ItemFn ) ;
134
135
135
136
// 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 ( )
137
139
&& 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 {
145
147
ReturnType :: Default => true ,
146
148
ReturnType :: Type ( _, ref ty) => match * * ty {
147
149
Type :: Tuple ( ref tuple) => tuple. elems . is_empty ( ) ,
@@ -166,7 +168,7 @@ pub fn pre_init(args: TokenStream, input: TokenStream) -> TokenStream {
166
168
167
169
// XXX should we blacklist other attributes?
168
170
let attrs = f. attrs ;
169
- let ident = f. ident ;
171
+ let ident = f. sig . ident ;
170
172
let block = f. block ;
171
173
172
174
quote ! (
0 commit comments