Update ui tests

This commit is contained in:
Oliver Scherer 2018-11-30 09:41:26 +01:00
parent 374a096cb1
commit 690439bb45
5 changed files with 29 additions and 28 deletions

View File

@ -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
};
}

View File

@ -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() {}

View File

@ -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 `()`

View File

@ -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,

View File

@ -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