]> git.lizzy.rs Git - rust.git/commitdiff
move deprecation-sanity test to ui
authorAndy Russell <arussell123@gmail.com>
Sat, 30 Jun 2018 17:02:58 +0000 (13:02 -0400)
committerAndy Russell <arussell123@gmail.com>
Sun, 1 Jul 2018 00:44:21 +0000 (20:44 -0400)
src/test/compile-fail/deprecation-sanity.rs [deleted file]
src/test/ui/deprecation-sanity.rs [new file with mode: 0644]
src/test/ui/deprecation-sanity.stderr [new file with mode: 0644]

diff --git a/src/test/compile-fail/deprecation-sanity.rs b/src/test/compile-fail/deprecation-sanity.rs
deleted file mode 100644 (file)
index af2ac79..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015 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.
-
-// Various checks that deprecation attributes are used correctly
-
-mod bogus_attribute_types_1 {
-    #[deprecated(since = "a", note = "a", reason)] //~ ERROR unknown meta item 'reason'
-    fn f1() { }
-
-    #[deprecated(since = "a", note)] //~ ERROR incorrect meta item
-    fn f2() { }
-
-    #[deprecated(since, note = "a")] //~ ERROR incorrect meta item
-    fn f3() { }
-
-    #[deprecated(since = "a", note(b))] //~ ERROR incorrect meta item
-    fn f5() { }
-
-    #[deprecated(since(b), note = "a")] //~ ERROR incorrect meta item
-    fn f6() { }
-}
-
-#[deprecated(since = "a", note = "b")]
-#[deprecated(since = "a", note = "b")]
-fn multiple1() { } //~ ERROR multiple deprecated attributes
-
-#[deprecated(since = "a", since = "b", note = "c")] //~ ERROR multiple 'since' items
-fn f1() { }
-
-fn main() { }
diff --git a/src/test/ui/deprecation-sanity.rs b/src/test/ui/deprecation-sanity.rs
new file mode 100644 (file)
index 0000000..af2ac79
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright 2015 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.
+
+// Various checks that deprecation attributes are used correctly
+
+mod bogus_attribute_types_1 {
+    #[deprecated(since = "a", note = "a", reason)] //~ ERROR unknown meta item 'reason'
+    fn f1() { }
+
+    #[deprecated(since = "a", note)] //~ ERROR incorrect meta item
+    fn f2() { }
+
+    #[deprecated(since, note = "a")] //~ ERROR incorrect meta item
+    fn f3() { }
+
+    #[deprecated(since = "a", note(b))] //~ ERROR incorrect meta item
+    fn f5() { }
+
+    #[deprecated(since(b), note = "a")] //~ ERROR incorrect meta item
+    fn f6() { }
+}
+
+#[deprecated(since = "a", note = "b")]
+#[deprecated(since = "a", note = "b")]
+fn multiple1() { } //~ ERROR multiple deprecated attributes
+
+#[deprecated(since = "a", since = "b", note = "c")] //~ ERROR multiple 'since' items
+fn f1() { }
+
+fn main() { }
diff --git a/src/test/ui/deprecation-sanity.stderr b/src/test/ui/deprecation-sanity.stderr
new file mode 100644 (file)
index 0000000..4481c61
--- /dev/null
@@ -0,0 +1,46 @@
+error[E0541]: unknown meta item 'reason'
+  --> $DIR/deprecation-sanity.rs:14:43
+   |
+LL |     #[deprecated(since = "a", note = "a", reason)] //~ ERROR unknown meta item 'reason'
+   |                                           ^^^^^^
+
+error[E0551]: incorrect meta item
+  --> $DIR/deprecation-sanity.rs:17:31
+   |
+LL |     #[deprecated(since = "a", note)] //~ ERROR incorrect meta item
+   |                               ^^^^
+
+error[E0551]: incorrect meta item
+  --> $DIR/deprecation-sanity.rs:20:18
+   |
+LL |     #[deprecated(since, note = "a")] //~ ERROR incorrect meta item
+   |                  ^^^^^
+
+error[E0551]: incorrect meta item
+  --> $DIR/deprecation-sanity.rs:23:31
+   |
+LL |     #[deprecated(since = "a", note(b))] //~ ERROR incorrect meta item
+   |                               ^^^^^^^
+
+error[E0551]: incorrect meta item
+  --> $DIR/deprecation-sanity.rs:26:18
+   |
+LL |     #[deprecated(since(b), note = "a")] //~ ERROR incorrect meta item
+   |                  ^^^^^^^^
+
+error[E0550]: multiple deprecated attributes
+  --> $DIR/deprecation-sanity.rs:32:1
+   |
+LL | fn multiple1() { } //~ ERROR multiple deprecated attributes
+   | ^^^^^^^^^^^^^^^^^^
+
+error[E0538]: multiple 'since' items
+  --> $DIR/deprecation-sanity.rs:34:27
+   |
+LL | #[deprecated(since = "a", since = "b", note = "c")] //~ ERROR multiple 'since' items
+   |                           ^^^^^^^^^^^
+
+error: aborting due to 7 previous errors
+
+Some errors occurred: E0538, E0541, E0550, E0551.
+For more information about an error, try `rustc --explain E0538`.