]> git.lizzy.rs Git - rust.git/blobdiff - 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
index 86945f83b55240a30af21ecd8c5460a666dbbb80..9736da80c2b7b178396f85e680e7ff358a15215c 100644 (file)
@@ -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(())
 }
 ```