From: Oliver Scherer Date: Fri, 30 Nov 2018 08:41:26 +0000 (+0100) Subject: Update ui tests X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=690439bb45e27f0fb76c05dcd8b5ae9adfc86c55;p=rust.git Update ui tests --- 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 `` +//~^ 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 @@ #[foo] fn a() { - let x: usize = "hello";;;;; + let x: usize = "hello";;;;; //~ ERROR mismatched types } #[foo] fn b(x: Option) -> usize { match x { - Some(x) => { return x }, + Some(x) => { return x }, //~ ERROR mismatched types None => 10 } } @@ -31,8 +32,8 @@ struct Bar { 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 @@ struct 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 { +struct A { //~ ERROR lifetime parameters must be declared t: &'a T, } -struct B { +struct B { //~ ERROR lifetime parameters must be declared t: &'a T, u: U, } -struct C { +struct C { //~ ERROR lifetime parameters must be declared t: &'a T, u: U, } -struct D { +struct D { //~ 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 { +LL | struct 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 { +LL | struct B { //~ 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 { +LL | struct C { //~ 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 { +LL | struct D { //~ 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