Skip to content

Commit 48fba76

Browse files
committed
Fix compile-fail error messages after integer suffix removal.
1 parent 8e50853 commit 48fba76

16 files changed

+26
-26
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() {
1212
let _x: i32 = [1, 2, 3];
1313
//~^ ERROR mismatched types
1414
//~| expected `i32`
15-
//~| found `[i32; 3]`
15+
//~| found `[_; 3]`
1616
//~| expected i32
1717
//~| found array of 3 elements
1818

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
static i: String = 10;
1212
//~^ ERROR mismatched types
1313
//~| expected `collections::string::String`
14-
//~| found `i32`
14+
//~| found `_`
1515
//~| expected struct `collections::string::String`
16-
//~| found i32
16+
//~| found integral variable
1717
fn main() { println!("{}", i); }

src/test/compile-fail/binop-logic-int.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:`&&` cannot be applied to type `i32`
11+
// error-pattern:`&&` cannot be applied to type `_`
1212

1313
fn main() { let x = 1 && 2; }

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
let _: &[i32] = [0];
1515
//~^ ERROR mismatched types
1616
//~| expected `&[i32]`
17-
//~| found `[i32; 1]`
17+
//~| found `[_; 1]`
1818
//~| expected &-ptr
1919
//~| found array of 1 elements
2020
}

src/test/compile-fail/issue-13058.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn main() {
3737
check((3, 5));
3838
//~^ ERROR mismatched types
3939
//~| expected `&_`
40-
//~| found `(usize, usize)`
40+
//~| found `(_, _)`
4141
//~| expected &-ptr
4242
//~| found tuple
4343
}

src/test/compile-fail/issue-13466.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ pub fn main() {
1717
let _x: usize = match Some(1) {
1818
Ok(u) => u,
1919
//~^ ERROR mismatched types
20-
//~| expected `core::option::Option<usize>`
20+
//~| expected `core::option::Option<_>`
2121
//~| found `core::result::Result<_, _>`
2222
//~| expected enum `core::option::Option`
2323
//~| found enum `core::result::Result`
2424

2525
Err(e) => panic!(e)
2626
//~^ ERROR mismatched types
27-
//~| expected `core::option::Option<usize>`
27+
//~| expected `core::option::Option<_>`
2828
//~| found `core::result::Result<_, _>`
2929
//~| expected enum `core::option::Option`
3030
//~| found enum `core::result::Result`

src/test/compile-fail/issue-13482-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn main() {
1515
let y = match x {
1616
[] => None,
1717
//~^ ERROR mismatched types
18-
//~| expected `[_#0; 2]`
18+
//~| expected `[_#0i; 2]`
1919
//~| found `[_#7t; 0]`
2020
//~| expected an array with a fixed size of 2 elements
2121
//~| found one with 0 elements

src/test/compile-fail/issue-14845.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fn main() {
2626
let _v = &local as *mut u8;
2727
//~^ ERROR mismatched types
2828
//~| expected `*mut u8`
29-
//~| found `&[u8; 1]`
29+
//~| found `&[_; 1]`
3030
//~| expected u8,
3131
//~| found array of 1 elements
3232
}

src/test/compile-fail/issue-17651.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
fn main() {
1515
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
1616
(|| Box::new(*[0].as_slice()))();
17-
//~^ ERROR the trait `core::marker::Sized` is not implemented for the type `[usize]`
17+
//~^ ERROR the trait `core::marker::Sized` is not implemented for the type `[_]`
1818
}

src/test/compile-fail/issue-19991.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
fn main() {
1515
if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause
1616
//~| expected `()`
17-
//~| found `i32`
17+
//~| found `_`
1818
//~| expected ()
19-
//~| found i32
19+
//~| found integral variable
2020
765
2121
};
2222
}

src/test/compile-fail/issue-7867.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ fn main() {
2626
match &Some(42) {
2727
Some(x) => (),
2828
//~^ ERROR mismatched types
29-
//~| expected `&core::option::Option<i32>`
29+
//~| expected `&core::option::Option<_>`
3030
//~| found `core::option::Option<_>`
3131
//~| expected &-ptr
3232
//~| found enum `core::option::Option`
3333
None => ()
3434
//~^ ERROR mismatched types
35-
//~| expected `&core::option::Option<i32>`
35+
//~| expected `&core::option::Option<_>`
3636
//~| found `core::option::Option<_>`
3737
//~| expected &-ptr
3838
//~| found enum `core::option::Option`

src/test/compile-fail/method-self-arg-1.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn main() {
2525
//~| found struct `Foo`
2626
Foo::bar(&42); //~ ERROR mismatched types
2727
//~| expected `&Foo`
28-
//~| found `&i32`
28+
//~| found `&_`
2929
//~| expected struct `Foo`
30-
//~| found i32
30+
//~| found integral variable
3131
}

src/test/compile-fail/mut-pattern-mismatched.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
// (separate lines to ensure the spans are accurate)
1515

1616
let &_ //~ ERROR mismatched types
17-
//~| expected `&mut i32`
17+
//~| expected `&mut _`
1818
//~| found `&_`
1919
//~| values differ in mutability
2020
= foo;
@@ -23,7 +23,7 @@ fn main() {
2323
let bar = &1;
2424
let &_ = bar;
2525
let &mut _ //~ ERROR mismatched types
26-
//~| expected `&i32`
26+
//~| expected `&_`
2727
//~| found `&mut _`
2828
//~| values differ in mutability
2929
= bar;

src/test/compile-fail/structure-constructor-type-mismatch.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,31 @@ fn main() {
2626
let pt = PointF {
2727
//~^ ERROR structure constructor specifies a structure of type
2828
//~| expected f32
29-
//~| found i32
29+
//~| found integral variable
3030
x: 1,
3131
y: 2,
3232
};
3333

3434
let pt2 = Point::<f32> {
3535
//~^ ERROR structure constructor specifies a structure of type
3636
//~| expected f32
37-
//~| found i32
37+
//~| found integral variable
3838
x: 3,
3939
y: 4,
4040
};
4141

4242
let pair = PairF {
4343
//~^ ERROR structure constructor specifies a structure of type
4444
//~| expected f32
45-
//~| found i32
45+
//~| found integral variable
4646
x: 5,
4747
y: 6,
4848
};
4949

5050
let pair2 = PairF::<i32> {
5151
//~^ ERROR structure constructor specifies a structure of type
5252
//~| expected f32
53-
//~| found i32
53+
//~| found integral variable
5454
x: 7,
5555
y: 8,
5656
};

src/test/compile-fail/tuple-index-out-of-bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ fn main() {
2020
tuple.0;
2121
tuple.1;
2222
tuple.2;
23-
//~^ ERROR attempted out-of-bounds tuple index `2` on type `(i32, i32)`
23+
//~^ ERROR attempted out-of-bounds tuple index `2` on type `(_, _)`
2424
}

src/test/compile-fail/type-mismatch-multiple.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
fn main() { let a: bool = 1; let b: i32 = true; }
1414
//~^ ERROR mismatched types
1515
//~| expected `bool`
16-
//~| found `i32`
16+
//~| found `_`
1717
//~| expected bool
18-
//~| found i32
18+
//~| found integral variable
1919
//~| ERROR mismatched types
2020
//~| expected `i32`
2121
//~| found `bool`

0 commit comments

Comments
 (0)