diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2020-08-14 14:46:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-14 14:46:51 -0700 |
| commit | 1cf79eca7905e1cd9766e6bca651d1d1ce4ba4f4 (patch) | |
| tree | f70bd7119bde11f7ee5d0c2da13ab55ff423f961 /src/librustc_error_codes/error_codes | |
| parent | b0261814f133792ad78ef11a62ddaa275476110e (diff) | |
| parent | 0ce97fc5112e3162b8396afe23848ac0b594a7ea (diff) | |
| download | rust-1cf79eca7905e1cd9766e6bca651d1d1ce4ba4f4.tar.gz rust-1cf79eca7905e1cd9766e6bca651d1d1ce4ba4f4.zip | |
Rollup merge of #75482 - GuillaumeGomez:cleanup-e0752, r=pickfire
Clean up E0752 explanation r? @Dylan-DPC cc @pickfire
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0752.md | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/librustc_error_codes/error_codes/E0752.md b/src/librustc_error_codes/error_codes/E0752.md index 86945f83b55..9736da80c2b 100644 --- a/src/librustc_error_codes/error_codes/E0752.md +++ b/src/librustc_error_codes/error_codes/E0752.md @@ -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(()) } ``` |
