about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSeo Sanghyeon <sanxiyn@gmail.com>2016-08-16 20:14:41 +0900
committerSeo Sanghyeon <sanxiyn@gmail.com>2016-08-16 20:46:50 +0900
commit3aa63400a27cbfefa3984aad5b52580e53b8f02d (patch)
treeefa38243c607e4a3577365e116ed622aba89eec9
parent13ff307f07327843348c0fb7476c4de77f95f89f (diff)
downloadrust-3aa63400a27cbfefa3984aad5b52580e53b8f02d.tar.gz
rust-3aa63400a27cbfefa3984aad5b52580e53b8f02d.zip
Use UI test to test spans, instead of forced line break
-rw-r--r--src/test/ui/span/move-closure.rs (renamed from src/test/compile-fail/move-closure-span.rs)5
-rw-r--r--src/test/ui/span/move-closure.stderr11
-rw-r--r--src/test/ui/span/type-binding.rs (renamed from src/test/compile-fail/ty_binding_span.rs)8
-rw-r--r--src/test/ui/span/type-binding.stderr8
4 files changed, 24 insertions, 8 deletions
diff --git a/src/test/compile-fail/move-closure-span.rs b/src/test/ui/span/move-closure.rs
index 3c590e892cc..e11ef0dddaa 100644
--- a/src/test/compile-fail/move-closure-span.rs
+++ b/src/test/ui/span/move-closure.rs
@@ -8,10 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// Regression test for issue #24986
 // Make sure that the span of a closure marked `move` begins at the `move` keyword.
 
 fn main() {
-    let x: () =
-    move //~ ERROR mismatched types
-    || ();
+    let x: () = move || ();
 }
diff --git a/src/test/ui/span/move-closure.stderr b/src/test/ui/span/move-closure.stderr
new file mode 100644
index 00000000000..251feded167
--- /dev/null
+++ b/src/test/ui/span/move-closure.stderr
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+  --> $DIR/move-closure.rs:15:17
+   |
+15 |     let x: () = move || ();
+   |                 ^^^^^^^^^^ expected (), found closure
+   |
+   = note: expected type `()`
+   = note:    found type `[closure@$DIR/move-closure.rs:15:17: 15:27]`
+
+error: aborting due to previous error
+
diff --git a/src/test/compile-fail/ty_binding_span.rs b/src/test/ui/span/type-binding.rs
index dd56ce5b3dd..05285c732f4 100644
--- a/src/test/compile-fail/ty_binding_span.rs
+++ b/src/test/ui/span/type-binding.rs
@@ -8,13 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// Regression test for issue #28158
 // Test the type binding span doesn't include >>
 
 use std::ops::Deref;
 
-fn homura<T: Deref<Trget=i32 //~ ERROR associated type
->>(_: T) { }
+fn homura<T: Deref<Trget = i32>>(_: T) {}
 
-
-fn main() {
-}
+fn main() {}
diff --git a/src/test/ui/span/type-binding.stderr b/src/test/ui/span/type-binding.stderr
new file mode 100644
index 00000000000..3cd1791a34f
--- /dev/null
+++ b/src/test/ui/span/type-binding.stderr
@@ -0,0 +1,8 @@
+error[E0220]: associated type `Trget` not found for `std::ops::Deref`
+  --> $DIR/type-binding.rs:16:20
+   |
+16 | fn homura<T: Deref<Trget = i32>>(_: T) {}
+   |                    ^^^^^^^^^^^
+
+error: aborting due to previous error
+