about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-11-04 03:01:56 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-11-04 03:09:47 +0300
commit33867579238ea94a1d22d1da344d6e484cacd9da (patch)
tree24793217d5a146846f07c30099a694fcf9fce52e
parentdb0be32fec539ab57c446433cb186f979af40413 (diff)
downloadrust-33867579238ea94a1d22d1da344d6e484cacd9da.tar.gz
rust-33867579238ea94a1d22d1da344d6e484cacd9da.zip
Move some tests to UI
-rw-r--r--src/test/ui/const-pattern-irrefutable.rs (renamed from src/test/compile-fail/const-pattern-irrefutable.rs)3
-rw-r--r--src/test/ui/const-pattern-irrefutable.stderr20
-rw-r--r--src/test/ui/resolve/name-clash-nullary.rs (renamed from src/test/compile-fail/name-clash-nullary.rs)5
-rw-r--r--src/test/ui/resolve/name-clash-nullary.stderr11
4 files changed, 31 insertions, 8 deletions
diff --git a/src/test/compile-fail/const-pattern-irrefutable.rs b/src/test/ui/const-pattern-irrefutable.rs
index 5aa5a92c3a7..af0b95e002d 100644
--- a/src/test/compile-fail/const-pattern-irrefutable.rs
+++ b/src/test/ui/const-pattern-irrefutable.rs
@@ -20,10 +20,7 @@ const a: u8 = 2;
 
 fn main() {
     let a = 4; //~ ERROR refutable pattern in local binding: `_` not covered
-               //~^ NOTE pattern `_` not covered
     let c = 4; //~ ERROR refutable pattern in local binding: `_` not covered
-               //~^ NOTE pattern `_` not covered
     let d = 4; //~ ERROR refutable pattern in local binding: `_` not covered
-               //~^ NOTE pattern `_` not covered
     fn f() {} // Check that the `NOTE`s still work with an item here (c.f. issue #35115).
 }
diff --git a/src/test/ui/const-pattern-irrefutable.stderr b/src/test/ui/const-pattern-irrefutable.stderr
new file mode 100644
index 00000000000..1f23eec43ef
--- /dev/null
+++ b/src/test/ui/const-pattern-irrefutable.stderr
@@ -0,0 +1,20 @@
+error[E0005]: refutable pattern in local binding: `_` not covered
+  --> $DIR/const-pattern-irrefutable.rs:22:9
+   |
+22 |     let a = 4; //~ ERROR refutable pattern in local binding: `_` not covered
+   |         ^ pattern `_` not covered
+
+error[E0005]: refutable pattern in local binding: `_` not covered
+  --> $DIR/const-pattern-irrefutable.rs:23:9
+   |
+23 |     let c = 4; //~ ERROR refutable pattern in local binding: `_` not covered
+   |         ^ pattern `_` not covered
+
+error[E0005]: refutable pattern in local binding: `_` not covered
+  --> $DIR/const-pattern-irrefutable.rs:24:9
+   |
+24 |     let d = 4; //~ ERROR refutable pattern in local binding: `_` not covered
+   |         ^ pattern `_` not covered
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/compile-fail/name-clash-nullary.rs b/src/test/ui/resolve/name-clash-nullary.rs
index 1b6b4713703..adf52c6d8e6 100644
--- a/src/test/compile-fail/name-clash-nullary.rs
+++ b/src/test/ui/resolve/name-clash-nullary.rs
@@ -8,11 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::option::*;
-
 fn main() {
   let None: isize = 42; //~ ERROR mismatched types
-  log(debug, None);
-  //~^ ERROR cannot find function `log` in this scope
-  //~| ERROR cannot find value `debug` in this scope
 }
diff --git a/src/test/ui/resolve/name-clash-nullary.stderr b/src/test/ui/resolve/name-clash-nullary.stderr
new file mode 100644
index 00000000000..014b1fe1b5b
--- /dev/null
+++ b/src/test/ui/resolve/name-clash-nullary.stderr
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+  --> $DIR/name-clash-nullary.rs:12:7
+   |
+12 |   let None: isize = 42; //~ ERROR mismatched types
+   |       ^^^^ expected isize, found enum `std::option::Option`
+   |
+   = note: expected type `isize`
+              found type `std::option::Option<_>`
+
+error: aborting due to previous error
+