about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/async-await/issue-68523-start.rs9
-rw-r--r--src/test/ui/async-await/issue-68523-start.stderr9
-rw-r--r--src/test/ui/async-await/issue-68523.rs7
-rw-r--r--src/test/ui/async-await/issue-68523.stderr18
4 files changed, 43 insertions, 0 deletions
diff --git a/src/test/ui/async-await/issue-68523-start.rs b/src/test/ui/async-await/issue-68523-start.rs
new file mode 100644
index 00000000000..5988dffd68f
--- /dev/null
+++ b/src/test/ui/async-await/issue-68523-start.rs
@@ -0,0 +1,9 @@
+// edition:2018
+
+#![feature(start)]
+
+#[start]
+pub async fn start(_: isize, _: *const *const u8) -> isize {
+//~^ ERROR start is not allowed to be `async`
+    0
+}
diff --git a/src/test/ui/async-await/issue-68523-start.stderr b/src/test/ui/async-await/issue-68523-start.stderr
new file mode 100644
index 00000000000..e471945900e
--- /dev/null
+++ b/src/test/ui/async-await/issue-68523-start.stderr
@@ -0,0 +1,9 @@
+error[E0752]: start is not allowed to be `async`
+  --> $DIR/issue-68523-start.rs:6:1
+   |
+LL | pub async fn start(_: isize, _: *const *const u8) -> isize {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ start is not allowed to be `async`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0752`.
diff --git a/src/test/ui/async-await/issue-68523.rs b/src/test/ui/async-await/issue-68523.rs
new file mode 100644
index 00000000000..e6250c40c71
--- /dev/null
+++ b/src/test/ui/async-await/issue-68523.rs
@@ -0,0 +1,7 @@
+// edition:2018
+
+async fn main() -> Result<i32, ()> {
+//~^ ERROR `main` function is not allowed to be `async`
+//~^^ ERROR `main` has invalid return type `impl std::future::Future`
+    Ok(1)
+}
diff --git a/src/test/ui/async-await/issue-68523.stderr b/src/test/ui/async-await/issue-68523.stderr
new file mode 100644
index 00000000000..62e37cf2629
--- /dev/null
+++ b/src/test/ui/async-await/issue-68523.stderr
@@ -0,0 +1,18 @@
+error[E0277]: `main` has invalid return type `impl std::future::Future`
+  --> $DIR/issue-68523.rs:3:20
+   |
+LL | async fn main() -> Result<i32, ()> {
+   |                    ^^^^^^^^^^^^^^^ `main` can only return types that implement `std::process::Termination`
+   |
+   = help: consider using `()`, or a `Result`
+
+error[E0752]: `main` function is not allowed to be `async`
+  --> $DIR/issue-68523.rs:3:1
+   |
+LL | async fn main() -> Result<i32, ()> {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `main` function is not allowed to be `async`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0277, E0752.
+For more information about an error, try `rustc --explain E0277`.