Closed
Description
If someone tries to do the following async fn main() -> Result<(), Box<dyn std::error::Error>
the error message is not helpful (though it is technically correct).
error[E0277]: `main` has invalid return type `impl futures::Future`
--> rs/agent-updater/src/main.rs:46:20
|
46 | async fn main() -> Result<(), Box<dyn std::error::Error>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `main` can only return types that implement `std::process::Termination`
|
= help: consider using `()`, or a `Result`
I think that it should point to the async
keyword and say that standard rust does not support async
main.
This issue has been assigned to @Nokel81 via this comment.
Metadata
Metadata
Assignees
Labels
Area: Async & AwaitArea: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Async-await issues that have been triaged during a working group meeting.Category: An issue proposing an enhancement or a PR with one.Diagnostics: Confusing error or lint that should be reworked.Diagnostics: An error or lint that needs small tweaks.Medium priorityRelevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
Status
Done