about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2018-11-30 09:41:26 +0100
committerOliver Scherer <github35764891676564198441@oli-obk.de>2018-12-04 10:06:05 +0100
commit690439bb45e27f0fb76c05dcd8b5ae9adfc86c55 (patch)
tree21f75bcdab2d0af98b68d6b425e70d8d1ff1e82e
parent374a096cb147b775e0eacb9d2a57f3686336078b (diff)
downloadrust-690439bb45e27f0fb76c05dcd8b5ae9adfc86c55.tar.gz
rust-690439bb45e27f0fb76c05dcd8b5ae9adfc86c55.zip
Update ui tests
-rw-r--r--src/test/ui/macros/macro-in-expression-context-2.rs2
-rw-r--r--src/test/ui/proc-macro/span-preservation.rs11
-rw-r--r--src/test/ui/proc-macro/span-preservation.stderr20
-rw-r--r--src/test/ui/suggestions/suggest-move-lifetimes.rs8
-rw-r--r--src/test/ui/suggestions/suggest-move-lifetimes.stderr16
5 files changed, 29 insertions, 28 deletions
diff --git a/src/test/ui/macros/macro-in-expression-context-2.rs b/src/test/ui/macros/macro-in-expression-context-2.rs
index 766f3135863..9423f0a359c 100644
--- a/src/test/ui/macros/macro-in-expression-context-2.rs
+++ b/src/test/ui/macros/macro-in-expression-context-2.rs
@@ -3,6 +3,6 @@ macro_rules! empty { () => () }
 fn main() {
     match 42 {
         _ => { empty!() }
-//~^ ERROR expected expression, found `<eof>`
+//~^ ERROR macro expansion ends with an incomplete expression
     };
 }
diff --git a/src/test/ui/proc-macro/span-preservation.rs b/src/test/ui/proc-macro/span-preservation.rs
index adcb42ab2d1..64f675ecc1c 100644
--- a/src/test/ui/proc-macro/span-preservation.rs
+++ b/src/test/ui/proc-macro/span-preservation.rs
@@ -1,3 +1,4 @@
+//~ ERROR mismatched types
 // aux-build:span-preservation.rs
 
 // For each of these, we should get the appropriate type mismatch error message,
@@ -9,13 +10,13 @@ use foo::foo;
 
 #[foo]
 fn a() {
-    let x: usize = "hello";;;;;
+    let x: usize = "hello";;;;; //~ ERROR mismatched types
 }
 
 #[foo]
 fn b(x: Option<isize>) -> usize {
     match x {
-        Some(x) => { return x },
+        Some(x) => { return x }, //~ ERROR mismatched types
         None => 10
     }
 }
@@ -31,8 +32,8 @@ fn c() {
         b: usize
     }
 
-    let x = Foo { a: 10isize };
-    let y = Foo { a: 10, b: 10isize };
+    let x = Foo { a: 10isize }; //~ ERROR mismatched types
+    let y = Foo { a: 10, b: 10isize }; //~ ERROR has no field named `b`
 }
 
 // FIXME: This doesn't work at the moment. See the one below. The pretty-printer
@@ -45,7 +46,7 @@ extern fn bar() {
 
 #[foo]
 extern "C" fn baz() {
-    0
+    0 //~ ERROR mismatched types
 }
 
 fn main() {}
diff --git a/src/test/ui/proc-macro/span-preservation.stderr b/src/test/ui/proc-macro/span-preservation.stderr
index f33245aec37..64d0173cb9c 100644
--- a/src/test/ui/proc-macro/span-preservation.stderr
+++ b/src/test/ui/proc-macro/span-preservation.stderr
@@ -4,40 +4,40 @@ error[E0308]: mismatched types
               found type `{integer}`
 
 error[E0308]: mismatched types
-  --> $DIR/span-preservation.rs:12:20
+  --> $DIR/span-preservation.rs:13:20
    |
-LL |     let x: usize = "hello";;;;;
+LL |     let x: usize = "hello";;;;; //~ ERROR mismatched types
    |                    ^^^^^^^ expected usize, found reference
    |
    = note: expected type `usize`
               found type `&'static str`
 
 error[E0308]: mismatched types
-  --> $DIR/span-preservation.rs:18:29
+  --> $DIR/span-preservation.rs:19:29
    |
-LL |         Some(x) => { return x },
+LL |         Some(x) => { return x }, //~ ERROR mismatched types
    |                             ^ expected usize, found isize
 
 error[E0308]: mismatched types
-  --> $DIR/span-preservation.rs:34:22
+  --> $DIR/span-preservation.rs:35:22
    |
-LL |     let x = Foo { a: 10isize };
+LL |     let x = Foo { a: 10isize }; //~ ERROR mismatched types
    |                      ^^^^^^^ expected usize, found isize
 
 error[E0560]: struct `c::Foo` has no field named `b`
-  --> $DIR/span-preservation.rs:35:26
+  --> $DIR/span-preservation.rs:36:26
    |
-LL |     let y = Foo { a: 10, b: 10isize };
+LL |     let y = Foo { a: 10, b: 10isize }; //~ ERROR has no field named `b`
    |                          ^ `c::Foo` does not have this field
    |
    = note: available fields are: `a`
 
 error[E0308]: mismatched types
-  --> $DIR/span-preservation.rs:48:5
+  --> $DIR/span-preservation.rs:49:5
    |
 LL | extern "C" fn baz() {
    |                     - possibly return type missing here?
-LL |     0
+LL |     0 //~ ERROR mismatched types
    |     ^ expected (), found integral variable
    |
    = note: expected type `()`
diff --git a/src/test/ui/suggestions/suggest-move-lifetimes.rs b/src/test/ui/suggestions/suggest-move-lifetimes.rs
index 5051a406078..6b26f121436 100644
--- a/src/test/ui/suggestions/suggest-move-lifetimes.rs
+++ b/src/test/ui/suggestions/suggest-move-lifetimes.rs
@@ -1,18 +1,18 @@
-struct A<T, 'a> {
+struct A<T, 'a> { //~ ERROR lifetime parameters must be declared
     t: &'a T,
 }
 
-struct B<T, 'a, U> {
+struct B<T, 'a, U> { //~ ERROR lifetime parameters must be declared
     t: &'a T,
     u: U,
 }
 
-struct C<T, U, 'a> {
+struct C<T, U, 'a> { //~ ERROR lifetime parameters must be declared
     t: &'a T,
     u: U,
 }
 
-struct D<T, U, 'a, 'b, V, 'c> {
+struct D<T, U, 'a, 'b, V, 'c> { //~ ERROR lifetime parameters must be declared
     t: &'a T,
     u: &'b U,
     v: &'c V,
diff --git a/src/test/ui/suggestions/suggest-move-lifetimes.stderr b/src/test/ui/suggestions/suggest-move-lifetimes.stderr
index f3d6469b512..72a2cbe6bf6 100644
--- a/src/test/ui/suggestions/suggest-move-lifetimes.stderr
+++ b/src/test/ui/suggestions/suggest-move-lifetimes.stderr
@@ -1,41 +1,41 @@
 error: lifetime parameters must be declared prior to type parameters
   --> $DIR/suggest-move-lifetimes.rs:1:13
    |
-LL | struct A<T, 'a> {
+LL | struct A<T, 'a> { //~ ERROR lifetime parameters must be declared
    |             ^^
 help: move the lifetime parameter prior to the first type parameter
    |
-LL | struct A<'a, T> {
+LL | struct A<'a, T> { //~ ERROR lifetime parameters must be declared
    |          ^^^ --
 
 error: lifetime parameters must be declared prior to type parameters
   --> $DIR/suggest-move-lifetimes.rs:5:13
    |
-LL | struct B<T, 'a, U> {
+LL | struct B<T, 'a, U> { //~ ERROR lifetime parameters must be declared
    |             ^^
 help: move the lifetime parameter prior to the first type parameter
    |
-LL | struct B<'a, T, U> {
+LL | struct B<'a, T, U> { //~ ERROR lifetime parameters must be declared
    |          ^^^   --
 
 error: lifetime parameters must be declared prior to type parameters
   --> $DIR/suggest-move-lifetimes.rs:10:16
    |
-LL | struct C<T, U, 'a> {
+LL | struct C<T, U, 'a> { //~ ERROR lifetime parameters must be declared
    |                ^^
 help: move the lifetime parameter prior to the first type parameter
    |
-LL | struct C<'a, T, U> {
+LL | struct C<'a, T, U> { //~ ERROR lifetime parameters must be declared
    |          ^^^    --
 
 error: lifetime parameters must be declared prior to type parameters
   --> $DIR/suggest-move-lifetimes.rs:15:16
    |
-LL | struct D<T, U, 'a, 'b, V, 'c> {
+LL | struct D<T, U, 'a, 'b, V, 'c> { //~ ERROR lifetime parameters must be declared
    |                ^^  ^^     ^^
 help: move the lifetime parameter prior to the first type parameter
    |
-LL | struct D<'a, 'b, 'c, T, U, V> {
+LL | struct D<'a, 'b, 'c, T, U, V> { //~ ERROR lifetime parameters must be declared
    |          ^^^ ^^^ ^^^      ---
 
 error: aborting due to 4 previous errors