File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ pub(crate) fn expand_export(
5656 self_ident,
5757 callback_interface : false ,
5858 } => {
59+ if let Some ( rt) = args. async_runtime {
60+ return Err ( syn:: Error :: new_spanned ( rt, "not supported for traits" ) ) ;
61+ }
62+
5963 let name = ident_to_string ( & self_ident) ;
6064 let free_fn_ident =
6165 Ident :: new ( & free_fn_symbol_name ( & mod_path, & name) , Span :: call_site ( ) ) ;
@@ -78,7 +82,15 @@ pub(crate) fn expand_export(
7882 let impl_tokens: TokenStream = items
7983 . into_iter ( )
8084 . map ( |item| match item {
81- ImplItem :: Method ( sig) => gen_method_scaffolding ( sig, & args) ,
85+ ImplItem :: Method ( sig) => {
86+ if sig. is_async {
87+ return Err ( syn:: Error :: new (
88+ sig. span ,
89+ "async trait methods are not supported" ,
90+ ) ) ;
91+ }
92+ gen_method_scaffolding ( sig, & args)
93+ }
8294 _ => unreachable ! ( "traits have no constructors" ) ,
8395 } )
8496 . collect :: < syn:: Result < _ > > ( ) ?;
You can’t perform that action at this time.
0 commit comments