From 6120acec8799616dbd7e646c1d7957eab894202b Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Wed, 8 Apr 2020 15:39:02 -0400 Subject: 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 --- src/librustc_error_codes/error_codes/E0752.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/librustc_error_codes/error_codes/E0752.md (limited to 'src/librustc_error_codes/error_codes') 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 { + Ok(1) +} +``` -- cgit 1.4.1-3-g733a5