Closed
Description
trait T {
async fn foo() {}
async fn bar(&self) {}
}
we currently emit
error[E0706]: trait fns cannot be declared `async`
--> src/lib.rs:2:5
|
2 | async fn foo() {}
| ^^^^^^^^^^^^^^^^^
error[E0706]: trait fns cannot be declared `async`
--> src/lib.rs:3:5
|
3 | async fn bar(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^
We should tell people that async
trait functions are not possible because of technical restrictions, and possibly point them to the async-trait
crate.
This issue has been assigned to @jafern14 via this comment.
Metadata
Metadata
Assignees
Labels
Area: Async & AwaitArea: Messages for errors, warnings, and lintsArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: Trait systemAsync-await issues that have been triaged during a working group meeting.Diagnostics: Confusing error or lint; hard to understand for new users.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Relevant to the compiler team, which will review and decide on the PR/issue.