about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndy Russell <arussell123@gmail.com>2018-10-04 15:49:29 -0400
committerAndy Russell <arussell123@gmail.com>2018-10-04 15:49:29 -0400
commit1ab1b1e6f859b45a8167a8225b05df766e218cff (patch)
treebc17af4584ebea8c11e9e59a62fa0ffe6b6777c0
parent6ddab3e078bc25bd101d6885427b8a1032f8f60c (diff)
downloadrust-1ab1b1e6f859b45a8167a8225b05df766e218cff.tar.gz
rust-1ab1b1e6f859b45a8167a8225b05df766e218cff.zip
add test for #28134
-rw-r--r--src/test/ui/issues/issue-28134.rs13
-rw-r--r--src/test/ui/issues/issue-28134.stderr8
2 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-28134.rs b/src/test/ui/issues/issue-28134.rs
new file mode 100644
index 00000000000..333b073503c
--- /dev/null
+++ b/src/test/ui/issues/issue-28134.rs
@@ -0,0 +1,13 @@
+// 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.
+
+// compile-flags: --test
+
+#![test] //~ ERROR only functions may be used as tests
diff --git a/src/test/ui/issues/issue-28134.stderr b/src/test/ui/issues/issue-28134.stderr
new file mode 100644
index 00000000000..cecbe5b9365
--- /dev/null
+++ b/src/test/ui/issues/issue-28134.stderr
@@ -0,0 +1,8 @@
+error: only functions may be used as tests
+  --> $DIR/issue-28134.rs:13:1
+   |
+LL | #![test] //~ ERROR only functions may be used as tests
+   | ^^^^^^^^
+
+error: aborting due to previous error
+