Closed davidli2010 closed 4 years ago
This is a compiler bug (https://github.com/rust-lang/rust/issues/43081). You can work around it by writing the decl macro as:
macro_rules! impl_t1 {
($ty:tt, $($id:tt)*) => {
#[async_trait]
impl T1 for $ty {
async fn id(&self) -> i32 {
$($id)*
}
}
};
}
This will be fixed in #105.
This is a compiler bug (rust-lang/rust#43081). You can work around it by writing the decl macro as:
macro_rules! impl_t1 { ($ty:tt, $($id:tt)*) => { #[async_trait] impl T1 for $ty { async fn id(&self) -> i32 { $($id)* } } }; }
It works. Thank you!
Hello there. I have problem with declarative macros. The code is simplified as below:
rust compiler generates an error: