Skip to content

Commit 690439b

Browse files
committed
Update ui tests
1 parent 374a096 commit 690439b

File tree

5 files changed

+29
-28
lines changed

5 files changed

+29
-28
lines changed

src/test/ui/macros/macro-in-expression-context-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ macro_rules! empty { () => () }
33
fn main() {
44
match 42 {
55
_ => { empty!() }
6-
//~^ ERROR expected expression, found `<eof>`
6+
//~^ ERROR macro expansion ends with an incomplete expression
77
};
88
}

src/test/ui/proc-macro/span-preservation.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//~ ERROR mismatched types
12
// aux-build:span-preservation.rs
23

34
// For each of these, we should get the appropriate type mismatch error message,
@@ -9,13 +10,13 @@ use foo::foo;
910

1011
#[foo]
1112
fn a() {
12-
let x: usize = "hello";;;;;
13+
let x: usize = "hello";;;;; //~ ERROR mismatched types
1314
}
1415

1516
#[foo]
1617
fn b(x: Option<isize>) -> usize {
1718
match x {
18-
Some(x) => { return x },
19+
Some(x) => { return x }, //~ ERROR mismatched types
1920
None => 10
2021
}
2122
}
@@ -31,8 +32,8 @@ fn c() {
3132
b: usize
3233
}
3334

34-
let x = Foo { a: 10isize };
35-
let y = Foo { a: 10, b: 10isize };
35+
let x = Foo { a: 10isize }; //~ ERROR mismatched types
36+
let y = Foo { a: 10, b: 10isize }; //~ ERROR has no field named `b`
3637
}
3738

3839
// FIXME: This doesn't work at the moment. See the one below. The pretty-printer
@@ -45,7 +46,7 @@ extern fn bar() {
4546

4647
#[foo]
4748
extern "C" fn baz() {
48-
0
49+
0 //~ ERROR mismatched types
4950
}
5051

5152
fn main() {}

src/test/ui/proc-macro/span-preservation.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,40 @@ error[E0308]: mismatched types
44
found type `{integer}`
55

66
error[E0308]: mismatched types
7-
--> $DIR/span-preservation.rs:12:20
7+
--> $DIR/span-preservation.rs:13:20
88
|
9-
LL | let x: usize = "hello";;;;;
9+
LL | let x: usize = "hello";;;;; //~ ERROR mismatched types
1010
| ^^^^^^^ expected usize, found reference
1111
|
1212
= note: expected type `usize`
1313
found type `&'static str`
1414

1515
error[E0308]: mismatched types
16-
--> $DIR/span-preservation.rs:18:29
16+
--> $DIR/span-preservation.rs:19:29
1717
|
18-
LL | Some(x) => { return x },
18+
LL | Some(x) => { return x }, //~ ERROR mismatched types
1919
| ^ expected usize, found isize
2020

2121
error[E0308]: mismatched types
22-
--> $DIR/span-preservation.rs:34:22
22+
--> $DIR/span-preservation.rs:35:22
2323
|
24-
LL | let x = Foo { a: 10isize };
24+
LL | let x = Foo { a: 10isize }; //~ ERROR mismatched types
2525
| ^^^^^^^ expected usize, found isize
2626

2727
error[E0560]: struct `c::Foo` has no field named `b`
28-
--> $DIR/span-preservation.rs:35:26
28+
--> $DIR/span-preservation.rs:36:26
2929
|
30-
LL | let y = Foo { a: 10, b: 10isize };
30+
LL | let y = Foo { a: 10, b: 10isize }; //~ ERROR has no field named `b`
3131
| ^ `c::Foo` does not have this field
3232
|
3333
= note: available fields are: `a`
3434

3535
error[E0308]: mismatched types
36-
--> $DIR/span-preservation.rs:48:5
36+
--> $DIR/span-preservation.rs:49:5
3737
|
3838
LL | extern "C" fn baz() {
3939
| - possibly return type missing here?
40-
LL | 0
40+
LL | 0 //~ ERROR mismatched types
4141
| ^ expected (), found integral variable
4242
|
4343
= note: expected type `()`

src/test/ui/suggestions/suggest-move-lifetimes.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
struct A<T, 'a> {
1+
struct A<T, 'a> { //~ ERROR lifetime parameters must be declared
22
t: &'a T,
33
}
44

5-
struct B<T, 'a, U> {
5+
struct B<T, 'a, U> { //~ ERROR lifetime parameters must be declared
66
t: &'a T,
77
u: U,
88
}
99

10-
struct C<T, U, 'a> {
10+
struct C<T, U, 'a> { //~ ERROR lifetime parameters must be declared
1111
t: &'a T,
1212
u: U,
1313
}
1414

15-
struct D<T, U, 'a, 'b, V, 'c> {
15+
struct D<T, U, 'a, 'b, V, 'c> { //~ ERROR lifetime parameters must be declared
1616
t: &'a T,
1717
u: &'b U,
1818
v: &'c V,

src/test/ui/suggestions/suggest-move-lifetimes.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
error: lifetime parameters must be declared prior to type parameters
22
--> $DIR/suggest-move-lifetimes.rs:1:13
33
|
4-
LL | struct A<T, 'a> {
4+
LL | struct A<T, 'a> { //~ ERROR lifetime parameters must be declared
55
| ^^
66
help: move the lifetime parameter prior to the first type parameter
77
|
8-
LL | struct A<'a, T> {
8+
LL | struct A<'a, T> { //~ ERROR lifetime parameters must be declared
99
| ^^^ --
1010

1111
error: lifetime parameters must be declared prior to type parameters
1212
--> $DIR/suggest-move-lifetimes.rs:5:13
1313
|
14-
LL | struct B<T, 'a, U> {
14+
LL | struct B<T, 'a, U> { //~ ERROR lifetime parameters must be declared
1515
| ^^
1616
help: move the lifetime parameter prior to the first type parameter
1717
|
18-
LL | struct B<'a, T, U> {
18+
LL | struct B<'a, T, U> { //~ ERROR lifetime parameters must be declared
1919
| ^^^ --
2020

2121
error: lifetime parameters must be declared prior to type parameters
2222
--> $DIR/suggest-move-lifetimes.rs:10:16
2323
|
24-
LL | struct C<T, U, 'a> {
24+
LL | struct C<T, U, 'a> { //~ ERROR lifetime parameters must be declared
2525
| ^^
2626
help: move the lifetime parameter prior to the first type parameter
2727
|
28-
LL | struct C<'a, T, U> {
28+
LL | struct C<'a, T, U> { //~ ERROR lifetime parameters must be declared
2929
| ^^^ --
3030

3131
error: lifetime parameters must be declared prior to type parameters
3232
--> $DIR/suggest-move-lifetimes.rs:15:16
3333
|
34-
LL | struct D<T, U, 'a, 'b, V, 'c> {
34+
LL | struct D<T, U, 'a, 'b, V, 'c> { //~ ERROR lifetime parameters must be declared
3535
| ^^ ^^ ^^
3636
help: move the lifetime parameter prior to the first type parameter
3737
|
38-
LL | struct D<'a, 'b, 'c, T, U, V> {
38+
LL | struct D<'a, 'b, 'c, T, U, V> { //~ ERROR lifetime parameters must be declared
3939
| ^^^ ^^^ ^^^ ---
4040

4141
error: aborting due to 4 previous errors

0 commit comments

Comments
 (0)