Skip to content

Commit

Permalink
Rollup merge of #75482 - GuillaumeGomez:cleanup-e0752, r=pickfire
Browse files Browse the repository at this point in the history
Clean up E0752 explanation

r? @Dylan-DPC

cc @pickfire
  • Loading branch information
tmandry authored Aug 14, 2020
2 parents b026181 + 0ce97fc commit 1cf79ec
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/librustc_error_codes/error_codes/E0752.md
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(())
}
```

0 comments on commit 1cf79ec

Please sign in to comment.