summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-05-19 20:10:34 +0000
committerbors <bors@rust-lang.org>2018-05-19 20:10:34 +0000
commita3085756edf66459109c4b07948b08fe3e78bc3b (patch)
tree770e960c0929a8b4f524497c96b0d62d9d79e621 /src/test/ui/error-codes
parent5c3960c2d6b8f538c96d824d9622112caf2d788c (diff)
parent218a81b06c2669f9d4a579db7c8ebab57d91c1e4 (diff)
downloadrust-a3085756edf66459109c4b07948b08fe3e78bc3b.tar.gz
rust-a3085756edf66459109c4b07948b08fe3e78bc3b.zip
Auto merge of #50782 - matthewjasper:wheres-main, r=matthewjasper
Prevent main from having a where clause.

Closes #50714

Should this have a crater run?

cc #48557, #48214

r? @nikomatsakis
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0646.rs11
-rw-r--r--src/test/ui/error-codes/E0646.stderr9
-rw-r--r--src/test/ui/error-codes/E0647.rs19
-rw-r--r--src/test/ui/error-codes/E0647.stderr11
4 files changed, 50 insertions, 0 deletions
diff --git a/src/test/ui/error-codes/E0646.rs b/src/test/ui/error-codes/E0646.rs
new file mode 100644
index 00000000000..5fc711d9408
--- /dev/null
+++ b/src/test/ui/error-codes/E0646.rs
@@ -0,0 +1,11 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() where (): Copy {} //~ ERROR [E0646]
diff --git a/src/test/ui/error-codes/E0646.stderr b/src/test/ui/error-codes/E0646.stderr
new file mode 100644
index 00000000000..96da22a643c
--- /dev/null
+++ b/src/test/ui/error-codes/E0646.stderr
@@ -0,0 +1,9 @@
+error[E0646]: main function is not allowed to have a where clause
+  --> $DIR/E0646.rs:11:1
+   |
+LL | fn main() where (): Copy {} //~ ERROR [E0646]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0646`.
diff --git a/src/test/ui/error-codes/E0647.rs b/src/test/ui/error-codes/E0647.rs
new file mode 100644
index 00000000000..0a0ffefdf95
--- /dev/null
+++ b/src/test/ui/error-codes/E0647.rs
@@ -0,0 +1,19 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![no_std]
+#![feature(start)]
+
+extern crate std;
+
+#[start]
+fn start(_: isize, _: *const *const u8) -> isize where (): Copy { //~ ERROR [E0647]
+    0
+}
diff --git a/src/test/ui/error-codes/E0647.stderr b/src/test/ui/error-codes/E0647.stderr
new file mode 100644
index 00000000000..f02407dcea6
--- /dev/null
+++ b/src/test/ui/error-codes/E0647.stderr
@@ -0,0 +1,11 @@
+error[E0647]: start function is not allowed to have a where clause
+  --> $DIR/E0647.rs:17:1
+   |
+LL | / fn start(_: isize, _: *const *const u8) -> isize where (): Copy { //~ ERROR [E0647]
+LL | |     0
+LL | | }
+   | |_^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0647`.