Skip to content

Commit 1cf79ec

Browse files
authored
Rollup merge of #75482 - GuillaumeGomez:cleanup-e0752, r=pickfire
Clean up E0752 explanation r? @Dylan-DPC cc @pickfire
2 parents b026181 + 0ce97fc commit 1cf79ec

File tree

1 file changed

+13
-5
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+13
-5
lines changed
Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
`fn main()` or the specified start function is not allowed to be
2-
async. You might be seeing this error because your async runtime
3-
library is not set up correctly.
1+
The entry point of the program was marked as `async`.
42

53
Erroneous code example:
64

75
```compile_fail,E0752
8-
async fn main() -> Result<i32, ()> {
9-
Ok(1)
6+
async fn main() -> Result<(), ()> { // error!
7+
Ok(())
8+
}
9+
```
10+
11+
`fn main()` or the specified start function is not allowed to be `async`. Not
12+
having a correct async runtime library setup may cause this error. To fix it,
13+
declare the entry point without `async`:
14+
15+
```
16+
fn main() -> Result<(), ()> { // ok!
17+
Ok(())
1018
}
1119
```

0 commit comments

Comments
 (0)