-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #75482 - GuillaumeGomez:cleanup-e0752, r=pickfire
Clean up E0752 explanation r? @Dylan-DPC cc @pickfire
- Loading branch information
Showing
1 changed file
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
`fn main()` or the specified start function is not allowed to be | ||
async. You might be seeing this error because your async runtime | ||
library is not set up correctly. | ||
The entry point of the program was marked as `async`. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0752 | ||
async fn main() -> Result<i32, ()> { | ||
Ok(1) | ||
async fn main() -> Result<(), ()> { // error! | ||
Ok(()) | ||
} | ||
``` | ||
|
||
`fn main()` or the specified start function is not allowed to be `async`. Not | ||
having a correct async runtime library setup may cause this error. To fix it, | ||
declare the entry point without `async`: | ||
|
||
``` | ||
fn main() -> Result<(), ()> { // ok! | ||
Ok(()) | ||
} | ||
``` |