Closed
Description
The async
keyword doesn't seem to currently work with specialization (namely default fn
). The order of keywords does not matter — I'm not sure which it's supposed to be.
Minimal example from @dtolnay in dtolnay/async-trait#25:
macro_rules! item {
($i:item) => {}
}
item! {
trait Trait {
async default fn f() {}
}
}
item! {
trait Trait {
default async fn f() {}
}
}
which gives the following error
error: expected one of `extern`, `fn`, or `unsafe`, found `default`
--> src/main.rs:7:15
|
7 | async default fn f() {}
| ^^^^^^^ expected one of `extern`, `fn`, or `unsafe` here
error: missing `fn`, `type`, or `const` for trait-item declaration
--> src/main.rs:12:18
|
12 | trait Trait {
| __________________^
13 | | default async fn f() {}
| |________^ missing `fn`, `type`, or `const`
error: aborting due to 2 previous errors