Skip to content

Commit bbad31d

Browse files
Clean up E0752 explanation
1 parent 441fd22 commit bbad31d

File tree

1 file changed

+12
-4
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+12
-4
lines changed
+12-4
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, ()> {
6+
async fn main() -> Result<i32, ()> { // error!
7+
Ok(1)
8+
}
9+
```
10+
11+
`fn main()` or the specified start function is not allowed to be `async`. You
12+
might be seeing this error because your async runtime library is not set up
13+
correctly. To fix it, don't declare the entry point as `async`:
14+
15+
```
16+
fn main() -> Result<i32, ()> { // ok!
917
Ok(1)
1018
}
1119
```

0 commit comments

Comments
 (0)