Skip to content

Commit 7b82a93

Browse files
committed
Fix testsuite errors
1 parent 5616b92 commit 7b82a93

File tree

95 files changed

+980
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+980
-221
lines changed

src/test/compile-fail/array-not-vector.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,18 @@
99
// except according to those terms.
1010

1111
fn main() {
12-
let _x: isize = [1is, 2, 3]; //~ ERROR expected isize, found array of 3 elements
12+
let _x: isize = [1is, 2, 3];
13+
//~^ ERROR mismatched types
14+
//~| expected `isize`
15+
//~| found `[isize; 3]`
16+
//~| expected isize
17+
//~| found array of 3 elements
1318

1419
let x: &[isize] = &[1, 2, 3];
15-
let _y: &isize = x; //~ ERROR expected isize, found slice
20+
let _y: &isize = x;
21+
//~^ ERROR mismatched types
22+
//~| expected `&isize`
23+
//~| found `&[isize]`
24+
//~| expected isize
25+
//~| found slice
1626
}

src/test/compile-fail/associated-types-eq-3.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ fn foo1<I: Foo<A=Bar>>(x: I) {
3030
}
3131

3232
fn foo2<I: Foo>(x: I) {
33-
let _: Bar = x.boo(); //~ERROR mismatched types
33+
let _: Bar = x.boo();
34+
//~^ ERROR mismatched types
35+
//~| expected `Bar`
36+
//~| found `<I as Foo>::A`
37+
//~| expected struct `Bar`
38+
//~| found associated type
3439
}
3540

3641

@@ -41,6 +46,12 @@ pub fn baz(x: &Foo<A=Bar>) {
4146

4247
pub fn main() {
4348
let a = 42is;
44-
foo1(a); //~ERROR expected usize, found struct Bar
45-
baz(&a); //~ERROR expected usize, found struct Bar
49+
foo1(a);
50+
//~^ ERROR type mismatch resolving
51+
//~| expected usize
52+
//~| found struct `Bar`
53+
baz(&a);
54+
//~^ ERROR type mismatch resolving
55+
//~| expected usize
56+
//~| found struct `Bar`
4657
}

src/test/compile-fail/associated-types-path-2.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ pub fn f2<T: Foo>(a: T) -> T::A {
2525

2626
pub fn f1_int_int() {
2727
f1(2is, 4is);
28-
//~^ ERROR expected usize, found isize
28+
//~^ ERROR type mismatch resolving
29+
//~| expected usize
30+
//~| found isize
2931
}
3032

3133
pub fn f1_int_uint() {
@@ -46,7 +48,11 @@ pub fn f1_uint_int() {
4648

4749
pub fn f2_int() {
4850
let _: isize = f2(2is);
49-
//~^ ERROR expected `isize`, found `usize`
51+
//~^ ERROR mismatched types
52+
//~| expected `isize`
53+
//~| found `usize`
54+
//~| expected isize
55+
//~| found usize
5056
}
5157

5258
pub fn main() { }

src/test/compile-fail/bad-const-type.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:expected `collections::string::String`, found `isize`
12-
1311
static i: String = 10is;
12+
//~^ ERROR mismatched types
13+
//~| expected `collections::string::String`
14+
//~| found `isize`
15+
//~| expected struct `collections::string::String`
16+
//~| found isize
1417
fn main() { println!("{}", i); }

src/test/compile-fail/block-must-not-have-result-do.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:mismatched types: expected `()`, found `bool`
12-
1311
fn main() {
1412
loop {
15-
true
13+
true //~ ERROR mismatched types
14+
//~| expected ()
15+
//~| found bool
16+
//~| expected ()
17+
//~| found bool
1618
}
1719
}

src/test/compile-fail/block-must-not-have-result-res.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:mismatched types: expected `()`, found `bool`
12-
1311
struct r;
1412

1513
impl Drop for r {
1614
fn drop(&mut self) {
17-
true
15+
true //~ ERROR mismatched types
16+
//~| expected ()
17+
//~| found bool
18+
//~| expected ()
19+
//~| found bool
1820
}
1921
}
2022

src/test/compile-fail/block-must-not-have-result-while.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:mismatched types: expected `()`, found `bool`
12-
1311
fn main() {
1412
while true {
15-
true
13+
true //~ ERROR mismatched types
14+
//~| expected `()`
15+
//~| found `bool`
16+
//~| expected ()
17+
//~| found bool
1618
}
1719
}

src/test/compile-fail/coercion-slice.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,10 @@
1111
// Tests that we forbid coercion from `[T; n]` to `&[T]`
1212

1313
fn main() {
14-
let _: &[isize] = [0is]; //~ERROR: mismatched types: expected `&[isize]`, found `[isize; 1]`
14+
let _: &[isize] = [0is];
15+
//~^ ERROR mismatched types
16+
//~| expected `&[isize]`
17+
//~| found `[isize; 1]`
18+
//~| expected &-ptr
19+
//~| found array of 1 elements
1520
}

src/test/compile-fail/const-cast-different-types.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@
1010

1111
static a: &'static str = "foo";
1212
static b: *const u8 = a as *const u8;
13-
//~^ ERROR mismatched types: expected `*const u8`, found `&'static str`
13+
//~^ ERROR mismatched types
14+
//~| expected *const u8
15+
//~| found &'static str
16+
//~| expected u8
17+
//~| found str
1418
static c: *const u8 = &a as *const u8;
15-
//~^ ERROR mismatched types: expected `*const u8`, found `&&'static str`
19+
//~^ ERROR mismatched types
20+
//~| expected *const u8
21+
//~| found &&'static str
22+
//~| expected u8
23+
//~| found &-ptr
1624

1725
fn main() {
1826
}

src/test/compile-fail/cross-borrow-trait.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ impl Trait for Foo {}
1919

2020
pub fn main() {
2121
let x: Box<Trait> = box Foo;
22-
let _y: &Trait = x; //~ ERROR mismatched types: expected `&Trait`, found `Box<Trait>`
22+
let _y: &Trait = x; //~ ERROR mismatched types
23+
//~| expected `&Trait`
24+
//~| found `Box<Trait>`
25+
//~| expected &-ptr
26+
//~| found box
2327
}
2428

0 commit comments

Comments
 (0)