diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-04-21 00:30:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-21 00:30:55 +0200 |
| commit | e3a514c44a7a896b210dcc59635452229703b9e6 (patch) | |
| tree | f3591bdc3bc72a2b0c02702bafa82b31f402ca23 /src/librustc_error_codes | |
| parent | 69a528eda688b3191127865f889fef65d979bb9c (diff) | |
| parent | 6120acec8799616dbd7e646c1d7957eab894202b (diff) | |
Rollup merge of #71174 - Nokel81:fix-async-main-error, r=petrochenkov
Check that main/start is not async * Add new error code E0752 * Add span to hir::IsAsync::Yes * Emit an error if main or the start function is marked as async * Add two regression tests This PR fixes #68523.
Diffstat (limited to 'src/librustc_error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes.rs | 1 | ||||
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0752.md | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/librustc_error_codes/error_codes.rs b/src/librustc_error_codes/error_codes.rs index 225ede851b4..bc04809eaa1 100644 --- a/src/librustc_error_codes/error_codes.rs +++ b/src/librustc_error_codes/error_codes.rs @@ -431,6 +431,7 @@ E0748: include_str!("./error_codes/E0748.md"), E0749: include_str!("./error_codes/E0749.md"), E0750: include_str!("./error_codes/E0750.md"), E0751: include_str!("./error_codes/E0751.md"), +E0752: include_str!("./error_codes/E0752.md"), ; // E0006, // merged with E0005 // E0008, // cannot bind by-move into a pattern guard diff --git a/src/librustc_error_codes/error_codes/E0752.md b/src/librustc_error_codes/error_codes/E0752.md new file mode 100644 index 00000000000..86945f83b55 --- /dev/null +++ b/src/librustc_error_codes/error_codes/E0752.md @@ -0,0 +1,11 @@ +`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. + +Erroneous code example: + +```compile_fail,E0752 +async fn main() -> Result<i32, ()> { + Ok(1) +} +``` |
