Skip to content

Commit 3a19df2

Browse files
committed
review comments: deduplicate tests
1 parent 45bbd14 commit 3a19df2

6 files changed

+4
-159
lines changed

src/test/ui/c-variadic/variadic-ffi-3.rs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/test/ui/c-variadic/variadic-ffi-3.stderr

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/test/ui/structs/struct-base-wrong-type-2.rs

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/test/ui/structs/struct-base-wrong-type-2.stderr

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
// Check that `base` in `Fru { field: expr, ..base }` must have right type.
2-
//
3-
// See also struct-base-wrong-type-2.rs, which tests same condition
4-
// within a function body.
52

63
struct Foo { a: isize, b: isize }
74
struct Bar { x: isize }
85

96
static bar: Bar = Bar { x: 5 };
107
static foo: Foo = Foo { a: 2, ..bar }; //~ ERROR mismatched types
11-
//~| expected type `Foo`
12-
//~| found type `Bar`
13-
//~| expected struct `Foo`, found struct `Bar`
148
static foo_i: Foo = Foo { a: 2, ..4 }; //~ ERROR mismatched types
15-
//~| expected type `Foo`
16-
//~| found type `{integer}`
17-
//~| expected struct `Foo`, found integer
189

1910
fn main() {
2011
let b = Bar { x: 5 };
21-
// See also struct-base-wrong-type-2.rs, which checks these errors on isolation.
2212
let f = Foo { a: 2, ..b }; //~ ERROR mismatched types
2313
let f__isize = Foo { a: 2, ..4 }; //~ ERROR mismatched types
2414
}

src/test/ui/structs/struct-base-wrong-type.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/struct-base-wrong-type.rs:10:33
2+
--> $DIR/struct-base-wrong-type.rs:7:33
33
|
44
LL | static foo: Foo = Foo { a: 2, ..bar };
55
| ^^^ expected struct `Foo`, found struct `Bar`
@@ -8,7 +8,7 @@ LL | static foo: Foo = Foo { a: 2, ..bar };
88
found type `Bar`
99

1010
error[E0308]: mismatched types
11-
--> $DIR/struct-base-wrong-type.rs:14:35
11+
--> $DIR/struct-base-wrong-type.rs:8:35
1212
|
1313
LL | static foo_i: Foo = Foo { a: 2, ..4 };
1414
| ^ expected struct `Foo`, found integer
@@ -17,7 +17,7 @@ LL | static foo_i: Foo = Foo { a: 2, ..4 };
1717
found type `{integer}`
1818

1919
error[E0308]: mismatched types
20-
--> $DIR/struct-base-wrong-type.rs:22:27
20+
--> $DIR/struct-base-wrong-type.rs:12:27
2121
|
2222
LL | let f = Foo { a: 2, ..b };
2323
| ^ expected struct `Foo`, found struct `Bar`
@@ -26,7 +26,7 @@ LL | let f = Foo { a: 2, ..b };
2626
found type `Bar`
2727

2828
error[E0308]: mismatched types
29-
--> $DIR/struct-base-wrong-type.rs:23:34
29+
--> $DIR/struct-base-wrong-type.rs:13:34
3030
|
3131
LL | let f__isize = Foo { a: 2, ..4 };
3232
| ^ expected struct `Foo`, found integer

0 commit comments

Comments
 (0)