Clean up E0752 explanation
This commit is contained in:
parent
441fd22557
commit
bbad31df2f
1 changed files with 12 additions and 4 deletions
|
|
@ -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)
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue