]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0752.md
Rollup merge of #75485 - RalfJung:pin, r=nagisa
[rust.git] / src / librustc_error_codes / error_codes / E0752.md
1 The entry point of the program was marked as `async`.
2
3 Erroneous code example:
4
5 ```compile_fail,E0752
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(())
18 }
19 ```