]> git.lizzy.rs Git - rust.git/commitdiff
Update compile-fail tests to be ui tests
authorWesley Wiser <wwiser@gmail.com>
Fri, 20 Jul 2018 03:30:42 +0000 (23:30 -0400)
committerWesley Wiser <wwiser@gmail.com>
Tue, 24 Jul 2018 01:24:38 +0000 (21:24 -0400)
src/test/compile-fail/issue-34784.rs [deleted file]
src/test/compile-fail/issue-42060.rs [deleted file]
src/test/compile-fail/issue-43196.rs [deleted file]
src/test/ui/issue-42060.rs [new file with mode: 0644]
src/test/ui/issue-42060.stderr [new file with mode: 0644]
src/test/ui/issue-43196.rs [new file with mode: 0644]
src/test/ui/issue-43196.stderr [new file with mode: 0644]

diff --git a/src/test/compile-fail/issue-34784.rs b/src/test/compile-fail/issue-34784.rs
deleted file mode 100644 (file)
index 5c510b4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// 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.
-
-const C: *const [u8; 4] = b"abcd";
-
-fn main() {
-    match C {
-        C => {}
-        //~^ ERROR this expression will panic at runtime
-        _ => {}
-    }
-}
-
diff --git a/src/test/compile-fail/issue-42060.rs b/src/test/compile-fail/issue-42060.rs
deleted file mode 100644 (file)
index 23df42d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// 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() {
-    let thing = ();
-    let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant
-    //~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516]
-}
-
-fn f(){
-    let q = 1;
-    <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant
-    //~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516]
-}
-
diff --git a/src/test/compile-fail/issue-43196.rs b/src/test/compile-fail/issue-43196.rs
deleted file mode 100644 (file)
index ff53c9a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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() {
-    |
-}
-//~^ ERROR expected `|`, found `}`
-|
-//~^ ERROR expected item, found `|`
-
diff --git a/src/test/ui/issue-42060.rs b/src/test/ui/issue-42060.rs
new file mode 100644 (file)
index 0000000..23df42d
--- /dev/null
@@ -0,0 +1,22 @@
+// 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() {
+    let thing = ();
+    let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant
+    //~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516]
+}
+
+fn f(){
+    let q = 1;
+    <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant
+    //~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516]
+}
+
diff --git a/src/test/ui/issue-42060.stderr b/src/test/ui/issue-42060.stderr
new file mode 100644 (file)
index 0000000..69abac8
--- /dev/null
@@ -0,0 +1,28 @@
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/issue-42060.rs:13:23
+   |
+LL |     let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant
+   |                       ^^^^^ non-constant value
+
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/issue-42060.rs:19:13
+   |
+LL |     <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant
+   |             ^ non-constant value
+
+error[E0516]: `typeof` is a reserved keyword but unimplemented
+  --> $DIR/issue-42060.rs:13:16
+   |
+LL |     let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant
+   |                ^^^^^^^^^^^^^ reserved keyword
+
+error[E0516]: `typeof` is a reserved keyword but unimplemented
+  --> $DIR/issue-42060.rs:19:6
+   |
+LL |     <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant
+   |      ^^^^^^^^^ reserved keyword
+
+error: aborting due to 4 previous errors
+
+Some errors occurred: E0435, E0516.
+For more information about an error, try `rustc --explain E0435`.
diff --git a/src/test/ui/issue-43196.rs b/src/test/ui/issue-43196.rs
new file mode 100644 (file)
index 0000000..ff53c9a
--- /dev/null
@@ -0,0 +1,17 @@
+// 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() {
+    |
+}
+//~^ ERROR expected `|`, found `}`
+|
+//~^ ERROR expected item, found `|`
+
diff --git a/src/test/ui/issue-43196.stderr b/src/test/ui/issue-43196.stderr
new file mode 100644 (file)
index 0000000..2418f51
--- /dev/null
@@ -0,0 +1,16 @@
+error: expected `|`, found `}`
+  --> $DIR/issue-43196.rs:13:1
+   |
+LL |     |
+   |      - expected `|` here
+LL | }
+   | ^ unexpected token
+
+error: expected item, found `|`
+  --> $DIR/issue-43196.rs:15:1
+   |
+LL | |
+   | ^ expected item
+
+error: aborting due to 2 previous errors
+