-
Couldn't load subscription status.
- Fork 13.9k
Closed
Closed
Copy link
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Description
When compiling for the 2018 edition, rustc allows async fn both outside of an impl and within an inherent impl.
When compiling for the 2015 edition, async fn works outside of an impl, but putting one inside an inherent impl produces this error:
error: missing `fn`, `type`, or `const` for impl-item declaration
--> src/lib.rs:4:9
|
4 | impl A { async fn inside_impl() {} }
| ^ missing `fn`, `type`, or `const`
Either this should be allowed, or it should result in a better error message that recommends switching to the 2018 edition.
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints