summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2018-05-18 22:03:24 +0100
committerMatthew Jasper <mjjasper1@gmail.com>2018-05-18 22:03:24 +0100
commit218a81b06c2669f9d4a579db7c8ebab57d91c1e4 (patch)
treea93c796df36b32819ce5c805778346673a643119 /src/test/ui/error-codes
parent27acb9b3c033e1dd74cc72310a5a346527d3e704 (diff)
downloadrust-218a81b06c2669f9d4a579db7c8ebab57d91c1e4.tar.gz
rust-218a81b06c2669f9d4a579db7c8ebab57d91c1e4.zip
Prevent main and start from having a where clause.
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`.