about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorSebastian Malton <smalton@mirantis.com>2020-04-08 15:39:02 -0400
committerSebastian Malton <smalton@mirantis.com>2020-04-20 09:37:11 -0400
commit6120acec8799616dbd7e646c1d7957eab894202b (patch)
treebb5e2fe36276198b77d71ad68c0127080fd84181 /src/librustc_error_codes/error_codes
parent8d67f576b56e8fc98a31123e5963f8d00e40611c (diff)
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

Fix formatting errors and bless test outputs
* move tests to ui/async-await

fix test error text

remove span from IsAsync
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0752.md11
1 files changed, 11 insertions, 0 deletions
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)
+}
+```