Skip to content

Commit

Permalink
Fix compile-fail error messages after integer suffix removal.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Mar 4, 2015
1 parent 8e50853 commit 48fba76
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/test/compile-fail/array-not-vector.rs
Expand Up @@ -12,7 +12,7 @@ fn main() {
let _x: i32 = [1, 2, 3];
//~^ ERROR mismatched types
//~| expected `i32`
//~| found `[i32; 3]`
//~| found `[_; 3]`
//~| expected i32
//~| found array of 3 elements

Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/bad-const-type.rs
Expand Up @@ -11,7 +11,7 @@
static i: String = 10;
//~^ ERROR mismatched types
//~| expected `collections::string::String`
//~| found `i32`
//~| found `_`
//~| expected struct `collections::string::String`
//~| found i32
//~| found integral variable
fn main() { println!("{}", i); }
2 changes: 1 addition & 1 deletion src/test/compile-fail/binop-logic-int.rs
Expand Up @@ -8,6 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

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

fn main() { let x = 1 && 2; }
2 changes: 1 addition & 1 deletion src/test/compile-fail/coercion-slice.rs
Expand Up @@ -14,7 +14,7 @@ fn main() {
let _: &[i32] = [0];
//~^ ERROR mismatched types
//~| expected `&[i32]`
//~| found `[i32; 1]`
//~| found `[_; 1]`
//~| expected &-ptr
//~| found array of 1 elements
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-13058.rs
Expand Up @@ -37,7 +37,7 @@ fn main() {
check((3, 5));
//~^ ERROR mismatched types
//~| expected `&_`
//~| found `(usize, usize)`
//~| found `(_, _)`
//~| expected &-ptr
//~| found tuple
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-13466.rs
Expand Up @@ -17,14 +17,14 @@ pub fn main() {
let _x: usize = match Some(1) {
Ok(u) => u,
//~^ ERROR mismatched types
//~| expected `core::option::Option<usize>`
//~| expected `core::option::Option<_>`
//~| found `core::result::Result<_, _>`
//~| expected enum `core::option::Option`
//~| found enum `core::result::Result`

Err(e) => panic!(e)
//~^ ERROR mismatched types
//~| expected `core::option::Option<usize>`
//~| expected `core::option::Option<_>`
//~| found `core::result::Result<_, _>`
//~| expected enum `core::option::Option`
//~| found enum `core::result::Result`
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-13482-2.rs
Expand Up @@ -15,7 +15,7 @@ fn main() {
let y = match x {
[] => None,
//~^ ERROR mismatched types
//~| expected `[_#0; 2]`
//~| expected `[_#0i; 2]`
//~| found `[_#7t; 0]`
//~| expected an array with a fixed size of 2 elements
//~| found one with 0 elements
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-14845.rs
Expand Up @@ -26,7 +26,7 @@ fn main() {
let _v = &local as *mut u8;
//~^ ERROR mismatched types
//~| expected `*mut u8`
//~| found `&[u8; 1]`
//~| found `&[_; 1]`
//~| expected u8,
//~| found array of 1 elements
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-17651.rs
Expand Up @@ -14,5 +14,5 @@
fn main() {
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
(|| Box::new(*[0].as_slice()))();
//~^ ERROR the trait `core::marker::Sized` is not implemented for the type `[usize]`
//~^ ERROR the trait `core::marker::Sized` is not implemented for the type `[_]`
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-19991.rs
Expand Up @@ -14,9 +14,9 @@
fn main() {
if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause
//~| expected `()`
//~| found `i32`
//~| found `_`
//~| expected ()
//~| found i32
//~| found integral variable
765
};
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-7867.rs
Expand Up @@ -26,13 +26,13 @@ fn main() {
match &Some(42) {
Some(x) => (),
//~^ ERROR mismatched types
//~| expected `&core::option::Option<i32>`
//~| expected `&core::option::Option<_>`
//~| found `core::option::Option<_>`
//~| expected &-ptr
//~| found enum `core::option::Option`
None => ()
//~^ ERROR mismatched types
//~| expected `&core::option::Option<i32>`
//~| expected `&core::option::Option<_>`
//~| found `core::option::Option<_>`
//~| expected &-ptr
//~| found enum `core::option::Option`
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/method-self-arg-1.rs
Expand Up @@ -25,7 +25,7 @@ fn main() {
//~| found struct `Foo`
Foo::bar(&42); //~ ERROR mismatched types
//~| expected `&Foo`
//~| found `&i32`
//~| found `&_`
//~| expected struct `Foo`
//~| found i32
//~| found integral variable
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/mut-pattern-mismatched.rs
Expand Up @@ -14,7 +14,7 @@ fn main() {
// (separate lines to ensure the spans are accurate)

let &_ //~ ERROR mismatched types
//~| expected `&mut i32`
//~| expected `&mut _`
//~| found `&_`
//~| values differ in mutability
= foo;
Expand All @@ -23,7 +23,7 @@ fn main() {
let bar = &1;
let &_ = bar;
let &mut _ //~ ERROR mismatched types
//~| expected `&i32`
//~| expected `&_`
//~| found `&mut _`
//~| values differ in mutability
= bar;
Expand Down
8 changes: 4 additions & 4 deletions src/test/compile-fail/structure-constructor-type-mismatch.rs
Expand Up @@ -26,31 +26,31 @@ fn main() {
let pt = PointF {
//~^ ERROR structure constructor specifies a structure of type
//~| expected f32
//~| found i32
//~| found integral variable
x: 1,
y: 2,
};

let pt2 = Point::<f32> {
//~^ ERROR structure constructor specifies a structure of type
//~| expected f32
//~| found i32
//~| found integral variable
x: 3,
y: 4,
};

let pair = PairF {
//~^ ERROR structure constructor specifies a structure of type
//~| expected f32
//~| found i32
//~| found integral variable
x: 5,
y: 6,
};

let pair2 = PairF::<i32> {
//~^ ERROR structure constructor specifies a structure of type
//~| expected f32
//~| found i32
//~| found integral variable
x: 7,
y: 8,
};
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/tuple-index-out-of-bounds.rs
Expand Up @@ -20,5 +20,5 @@ fn main() {
tuple.0;
tuple.1;
tuple.2;
//~^ ERROR attempted out-of-bounds tuple index `2` on type `(i32, i32)`
//~^ ERROR attempted out-of-bounds tuple index `2` on type `(_, _)`
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/type-mismatch-multiple.rs
Expand Up @@ -13,9 +13,9 @@
fn main() { let a: bool = 1; let b: i32 = true; }
//~^ ERROR mismatched types
//~| expected `bool`
//~| found `i32`
//~| found `_`
//~| expected bool
//~| found i32
//~| found integral variable
//~| ERROR mismatched types
//~| expected `i32`
//~| found `bool`
Expand Down

0 comments on commit 48fba76

Please sign in to comment.