-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with specialization #25
Labels
Comments
This looks like a compiler bug -- it fails in rustc's parser before even hitting async_trait. macro_rules! item {
($i:item) => {}
}
item! {
trait Trait {
async default fn f() {}
}
}
item! {
trait Trait {
default async fn f() {}
}
} 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 Could you follow up with a bug report in rust-lang/rust? |
Filed as rust-lang/rust#63716. |
Specialization works as of the rustc parser fix in rust-lang/rust#63759. The Responder<'r> trait would probably still be blocked on #28. |
Should work as of async-trait 0.1.12 thanks to #30. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Rocket, there's currently the following function:
I'm looking into rewriting the traits using this crate, and would like to write the function as
When doing this, I get an error.
I presume this is because of specialization, as it seems to work everywhere else.
The text was updated successfully, but these errors were encountered: