Clean up E0752 explanation

This commit is contained in:
Guillaume Gomez 2020-08-13 13:07:27 +02:00
parent 441fd22557
commit bbad31df2f

View file

@ -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, ()> {
async fn main() -> Result<i32, ()> { // error!
Ok(1)
}
```
`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. To fix it, don't declare the entry point as `async`:
```
fn main() -> Result<i32, ()> { // ok!
Ok(1)
}
```