1
Fork 0

Rollup merge of #75482 - GuillaumeGomez:cleanup-e0752, r=pickfire

Clean up E0752 explanation

r? @Dylan-DPC

cc @pickfire
This commit is contained in:
Tyler Mandry 2020-08-14 14:46:51 -07:00 committed by GitHub
commit 1cf79eca79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,19 @@
`fn main()` or the specified start function is not allowed to be The entry point of the program was marked as `async`.
async. You might be seeing this error because your async runtime
library is not set up correctly.
Erroneous code example: Erroneous code example:
```compile_fail,E0752 ```compile_fail,E0752
async fn main() -> Result<i32, ()> { async fn main() -> Result<(), ()> { // error!
Ok(1) 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(())
} }
``` ```