From e416518e6862335a9c99f4c9dfe23192bac3cab8 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 20 Apr 2016 14:42:13 -0400 Subject: [PATCH] update test cases to reflect new messages --- src/test/compile-fail/array-not-vector.rs | 14 +-- .../compile-fail/associated-types-eq-3.rs | 7 +- .../compile-fail/associated-types-path-2.rs | 6 +- .../compile-fail/augmented-assignments.rs | 4 +- src/test/compile-fail/bad-const-type.rs | 7 +- src/test/compile-fail/bad-main.rs | 2 +- src/test/compile-fail/binop-move-semantics.rs | 2 + .../block-must-not-have-result-while.rs | 7 +- .../borrowck/borrowck-box-insensitivity.rs | 46 +++++--- .../borrowck/borrowck-closures-mut-of-imm.rs | 2 +- .../borrowck/borrowck-closures-unique.rs | 2 +- .../borrowck/borrowck-lend-flow-loop.rs | 1 + .../borrowck-mut-borrow-linear-errors.rs | 1 + .../borrowck-report-with-custom-diagnostic.rs | 15 ++- src/test/compile-fail/closure-wrong-kind.rs | 2 +- src/test/compile-fail/coerce-mut.rs | 4 +- src/test/compile-fail/coercion-slice.rs | 7 +- src/test/compile-fail/cross-borrow-trait.rs | 7 +- .../compile-fail/default_ty_param_conflict.rs | 3 + .../default_ty_param_conflict_cross_crate.rs | 6 +- .../compile-fail/destructure-trait-ref.rs | 21 ++-- src/test/compile-fail/dst-bad-assign.rs | 7 +- src/test/compile-fail/dst-bad-coerce4.rs | 7 +- .../explicit-self-lifetime-mismatch.rs | 8 +- src/test/compile-fail/extern-main-fn.rs | 2 +- src/test/compile-fail/fn-item-type.rs | 20 ++-- src/test/compile-fail/fn-trait-formatting.rs | 21 ++-- .../fully-qualified-type-name1.rs | 7 +- .../fully-qualified-type-name2.rs | 7 +- .../fully-qualified-type-name4.rs | 7 +- .../generic-type-params-name-repr.rs | 42 +++---- src/test/compile-fail/if-branch-types.rs | 3 +- src/test/compile-fail/if-let-arm-types.rs | 3 + .../compile-fail/if-without-else-result.rs | 7 +- .../integer-literal-suffix-inference.rs | 108 ++++++------------ .../integral-variable-unification-error.rs | 7 +- src/test/compile-fail/issue-10176.rs | 7 +- src/test/compile-fail/issue-11319.rs | 9 +- src/test/compile-fail/issue-12997-2.rs | 7 +- src/test/compile-fail/issue-13359.rs | 6 +- src/test/compile-fail/issue-13466.rs | 14 +-- src/test/compile-fail/issue-13482-2.rs | 7 +- src/test/compile-fail/issue-13482.rs | 4 +- src/test/compile-fail/issue-13624.rs | 14 +-- src/test/compile-fail/issue-14091.rs | 7 +- src/test/compile-fail/issue-14541.rs | 7 +- src/test/compile-fail/issue-15783.rs | 7 +- src/test/compile-fail/issue-15896.rs | 7 +- src/test/compile-fail/issue-16338.rs | 7 +- src/test/compile-fail/issue-16401.rs | 7 +- src/test/compile-fail/issue-17033.rs | 7 +- src/test/compile-fail/issue-17263.rs | 14 ++- src/test/compile-fail/issue-17283.rs | 21 ++-- src/test/compile-fail/issue-17728.rs | 3 + src/test/compile-fail/issue-17740.rs | 8 +- src/test/compile-fail/issue-19109.rs | 9 +- src/test/compile-fail/issue-19991.rs | 7 +- src/test/compile-fail/issue-24036.rs | 6 + src/test/compile-fail/issue-24357.rs | 4 +- src/test/compile-fail/issue-24446.rs | 2 +- src/test/compile-fail/issue-26480.rs | 1 + src/test/compile-fail/issue-27008.rs | 7 +- src/test/compile-fail/issue-29084.rs | 5 +- src/test/compile-fail/issue-2951.rs | 7 +- src/test/compile-fail/issue-3477.rs | 3 +- src/test/compile-fail/issue-3680.rs | 7 +- src/test/compile-fail/issue-4201.rs | 7 +- src/test/compile-fail/issue-4517.rs | 7 +- src/test/compile-fail/issue-4968.rs | 7 +- src/test/compile-fail/issue-5100.rs | 40 +++---- src/test/compile-fail/issue-5358-1.rs | 7 +- src/test/compile-fail/issue-5500.rs | 7 +- src/test/compile-fail/issue-7061.rs | 7 +- src/test/compile-fail/issue-7092.rs | 9 +- src/test/compile-fail/issue-7867.rs | 21 ++-- src/test/compile-fail/issue-9575.rs | 2 +- src/test/compile-fail/main-wrong-type-2.rs | 2 +- src/test/compile-fail/main-wrong-type.rs | 2 +- src/test/compile-fail/match-range-fail.rs | 3 +- src/test/compile-fail/match-struct.rs | 7 +- src/test/compile-fail/match-vec-mismatch-2.rs | 7 +- src/test/compile-fail/method-self-arg-1.rs | 14 +-- ...ased-on-type-distribute-copy-over-paren.rs | 8 +- .../moves-based-on-type-match-bindings.rs | 2 + .../compile-fail/mut-pattern-mismatched.rs | 8 +- src/test/compile-fail/noexporttypeexe.rs | 7 +- src/test/compile-fail/occurs-check-2.rs | 4 +- src/test/compile-fail/occurs-check.rs | 4 +- .../compile-fail/pattern-error-continue.rs | 10 +- src/test/compile-fail/pptypedef.rs | 6 +- src/test/compile-fail/ptr-coercion.rs | 12 +- src/test/compile-fail/ref-suggestion.rs | 6 - src/test/compile-fail/regions-bounds.rs | 8 +- .../regions-early-bound-error-method.rs | 4 +- .../regions-fn-subtyping-return-static.rs | 7 +- .../compile-fail/regions-infer-not-param.rs | 8 +- .../regions-infer-paramd-indirect.rs | 4 +- .../reject-specialized-drops-8142.rs | 4 +- src/test/compile-fail/repeat_count.rs | 41 +++---- .../compile-fail/shift-various-bad-types.rs | 3 +- src/test/compile-fail/slice-mut.rs | 4 +- .../slightly-nice-generic-literal-messages.rs | 7 +- .../compile-fail/struct-base-wrong-type-2.rs | 14 +-- .../compile-fail/struct-base-wrong-type.rs | 14 +-- .../structure-constructor-type-mismatch.rs | 18 +-- src/test/compile-fail/substs-ppaux.rs | 32 +++--- src/test/compile-fail/suppressed-error.rs | 7 +- .../tag-that-dare-not-speak-its-name.rs | 7 +- src/test/compile-fail/terr-in-field.rs | 7 +- src/test/compile-fail/terr-sorts.rs | 7 +- .../compile-fail/token-error-correct-3.rs | 3 + .../compile-fail/trait-bounds-cant-coerce.rs | 7 +- src/test/compile-fail/tuple-arity-mismatch.rs | 14 +-- .../tutorial-suffix-inference-test.rs | 9 +- .../compile-fail/type-mismatch-multiple.rs | 10 +- .../type-mismatch-same-crate-name.rs | 16 ++- src/test/compile-fail/type-parameter-names.rs | 7 +- .../type-params-in-different-spaces-1.rs | 7 +- .../typeck_type_placeholder_mismatch.rs | 14 +-- .../compile-fail/ufcs-explicit-self-bad.rs | 8 +- src/test/compile-fail/variadic-ffi-3.rs | 14 +-- 121 files changed, 534 insertions(+), 630 deletions(-) diff --git a/src/test/compile-fail/array-not-vector.rs b/src/test/compile-fail/array-not-vector.rs index 6c9b8f81b2faf..1bbccae53a44d 100644 --- a/src/test/compile-fail/array-not-vector.rs +++ b/src/test/compile-fail/array-not-vector.rs @@ -11,16 +11,14 @@ fn main() { let _x: i32 = [1, 2, 3]; //~^ ERROR mismatched types - //~| expected `i32` - //~| found `[_; 3]` - //~| expected i32 - //~| found array of 3 elements + //~| expected type `i32` + //~| found type `[_; 3]` + //~| expected i32, found array of 3 elements let x: &[i32] = &[1, 2, 3]; let _y: &i32 = x; //~^ ERROR mismatched types - //~| expected `&i32` - //~| found `&[i32]` - //~| expected i32 - //~| found slice + //~| expected type `&i32` + //~| found type `&[i32]` + //~| expected i32, found slice } diff --git a/src/test/compile-fail/associated-types-eq-3.rs b/src/test/compile-fail/associated-types-eq-3.rs index f01f2b111c5c1..8c66160e8a36f 100644 --- a/src/test/compile-fail/associated-types-eq-3.rs +++ b/src/test/compile-fail/associated-types-eq-3.rs @@ -32,10 +32,9 @@ fn foo1>(x: I) { fn foo2(x: I) { let _: Bar = x.boo(); //~^ ERROR mismatched types - //~| expected `Bar` - //~| found `::A` - //~| expected struct `Bar` - //~| found associated type + //~| expected type `Bar` + //~| found type `::A` + //~| expected struct `Bar`, found associated type } diff --git a/src/test/compile-fail/associated-types-path-2.rs b/src/test/compile-fail/associated-types-path-2.rs index 68fba56427cc5..cdb7dff692c14 100644 --- a/src/test/compile-fail/associated-types-path-2.rs +++ b/src/test/compile-fail/associated-types-path-2.rs @@ -28,8 +28,7 @@ pub fn f2(a: T) -> T::A { pub fn f1_int_int() { f1(2i32, 4i32); //~^ ERROR mismatched types - //~| expected `u32` - //~| found `i32` + //~| expected u32, found i32 } pub fn f1_int_uint() { @@ -49,8 +48,7 @@ pub fn f1_uint_int() { pub fn f2_int() { let _: i32 = f2(2i32); //~^ ERROR mismatched types - //~| expected `i32` - //~| found `u32` + //~| expected i32, found u32 } pub fn main() { } diff --git a/src/test/compile-fail/augmented-assignments.rs b/src/test/compile-fail/augmented-assignments.rs index 221015d512062..8ac6b419295ee 100644 --- a/src/test/compile-fail/augmented-assignments.rs +++ b/src/test/compile-fail/augmented-assignments.rs @@ -21,8 +21,10 @@ impl AddAssign for Int { fn main() { let mut x = Int(1); x //~ error: use of moved value: `x` + //~^ value used here after move + //~| note: move occurs because `x` has type `Int` += - x; //~ note: `x` moved here because it has type `Int`, which is non-copyable + x; //~ value moved here let y = Int(2); y //~ error: cannot borrow immutable local variable `y` as mutable diff --git a/src/test/compile-fail/bad-const-type.rs b/src/test/compile-fail/bad-const-type.rs index f05c8c31f1024..ee6ac33072792 100644 --- a/src/test/compile-fail/bad-const-type.rs +++ b/src/test/compile-fail/bad-const-type.rs @@ -10,8 +10,7 @@ static i: String = 10; //~^ ERROR mismatched types -//~| expected `std::string::String` -//~| found `_` -//~| expected struct `std::string::String` -//~| found integral variable +//~| expected type `std::string::String` +//~| found type `_` +//~| expected struct `std::string::String`, found integral variable fn main() { println!("{}", i); } diff --git a/src/test/compile-fail/bad-main.rs b/src/test/compile-fail/bad-main.rs index 321dca8989134..1253f7569e7e8 100644 --- a/src/test/compile-fail/bad-main.rs +++ b/src/test/compile-fail/bad-main.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn main(x: isize) { } //~ ERROR: main function expects type +fn main(x: isize) { } //~ ERROR: main function has wrong type diff --git a/src/test/compile-fail/binop-move-semantics.rs b/src/test/compile-fail/binop-move-semantics.rs index cff0064497aff..0cc6ea3e984d9 100644 --- a/src/test/compile-fail/binop-move-semantics.rs +++ b/src/test/compile-fail/binop-move-semantics.rs @@ -62,6 +62,7 @@ fn mut_plus_immut() { &mut f + &f; //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable + //~^ cannot borrow `f` as immutable because it is also borrowed as mutable } fn immut_plus_mut() { @@ -70,6 +71,7 @@ fn immut_plus_mut() { &f + &mut f; //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable + //~^ cannot borrow `f` as mutable because it is also borrowed as immutable } fn main() {} diff --git a/src/test/compile-fail/block-must-not-have-result-while.rs b/src/test/compile-fail/block-must-not-have-result-while.rs index ba6340ed395ee..a0fb470e1e4d0 100644 --- a/src/test/compile-fail/block-must-not-have-result-while.rs +++ b/src/test/compile-fail/block-must-not-have-result-while.rs @@ -11,9 +11,8 @@ fn main() { while true { true //~ ERROR mismatched types - //~| expected `()` - //~| found `bool` - //~| expected () - //~| found bool + //~| expected type `()` + //~| found type `bool` + //~| expected (), found bool } } diff --git a/src/test/compile-fail/borrowck/borrowck-box-insensitivity.rs b/src/test/compile-fail/borrowck/borrowck-box-insensitivity.rs index 7c3d632078fe2..bde3212c5bc63 100644 --- a/src/test/compile-fail/borrowck/borrowck-box-insensitivity.rs +++ b/src/test/compile-fail/borrowck/borrowck-box-insensitivity.rs @@ -33,22 +33,28 @@ struct D { fn copy_after_move() { let a: Box<_> = box A { x: box 0, y: 1 }; let _x = a.x; + //~^ value moved here let _y = a.y; //~ ERROR use of moved - //~^^ NOTE `a` moved here (through moving `a.x`) + //~^ move occurs because `a.x` has type `Box` + //~| value used here after move } fn move_after_move() { let a: Box<_> = box B { x: box 0, y: box 1 }; let _x = a.x; + //~^ value moved here let _y = a.y; //~ ERROR use of moved - //~^^ NOTE `a` moved here (through moving `a.x`) + //~^ move occurs because `a.x` has type `Box` + //~| value used here after move } fn borrow_after_move() { let a: Box<_> = box A { x: box 0, y: 1 }; let _x = a.x; + //~^ value moved here let _y = &a.y; //~ ERROR use of moved - //~^^ NOTE `a` moved here (through moving `a.x`) + //~^ move occurs because `a.x` has type `Box` + //~| value used here after move } fn move_after_borrow() { @@ -75,44 +81,52 @@ fn move_after_mut_borrow() { fn borrow_after_mut_borrow() { let mut a: Box<_> = box A { x: box 0, y: 1 }; let _x = &mut a.x; - //~^ NOTE previous borrow of `a` occurs here (through borrowing `a.x`); + //~^ NOTE mutable borrow occurs here (via `a.x`) let _y = &a.y; //~ ERROR cannot borrow + //~^ immutable borrow occurs here (via `a.y`) } -//~^ NOTE previous borrow ends here +//~^ NOTE mutable borrow ends here fn mut_borrow_after_borrow() { let mut a: Box<_> = box A { x: box 0, y: 1 }; let _x = &a.x; - //~^ NOTE previous borrow of `a` occurs here (through borrowing `a.x`) + //~^ NOTE immutable borrow occurs here (via `a.x`) let _y = &mut a.y; //~ ERROR cannot borrow + //~^ mutable borrow occurs here (via `a.y`) } -//~^ NOTE previous borrow ends here +//~^ NOTE immutable borrow ends here fn copy_after_move_nested() { let a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 }; let _x = a.x.x; - //~^ NOTE `a.x.x` moved here because it has type `Box`, which is moved by default + //~^ value moved here let _y = a.y; //~ ERROR use of collaterally moved + //~^ NOTE move occurs because `a.x.x` has type `Box` + //~| value used here after move } fn move_after_move_nested() { let a: Box<_> = box D { x: box A { x: box 0, y: 1 }, y: box 2 }; let _x = a.x.x; - //~^ NOTE `a.x.x` moved here because it has type `Box`, which is moved by default + //~^ value moved here let _y = a.y; //~ ERROR use of collaterally moved + //~^ NOTE move occurs because `a.x.x` has type `Box` + //~| value used here after move } fn borrow_after_move_nested() { let a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 }; let _x = a.x.x; - //~^ NOTE `a.x.x` moved here because it has type `Box`, which is moved by default + //~^ value moved here let _y = &a.y; //~ ERROR use of collaterally moved + //~^ NOTE move occurs because `a.x.x` has type `Box` + //~| value used here after move } fn move_after_borrow_nested() { let a: Box<_> = box D { x: box A { x: box 0, y: 1 }, y: box 2 }; let _x = &a.x.x; - //~^ NOTE borrow of `a.x.x` occurs here + //~^ borrow of `a.x.x` occurs here let _y = a.y; //~ ERROR cannot move } @@ -133,18 +147,20 @@ fn move_after_mut_borrow_nested() { fn borrow_after_mut_borrow_nested() { let mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 }; let _x = &mut a.x.x; - //~^ NOTE previous borrow of `a.x.x` occurs here; the mutable borrow prevents + //~^ mutable borrow occurs here let _y = &a.y; //~ ERROR cannot borrow + //~^ immutable borrow occurs here } -//~^ NOTE previous borrow ends here +//~^ NOTE mutable borrow ends here fn mut_borrow_after_borrow_nested() { let mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 }; let _x = &a.x.x; - //~^ NOTE previous borrow of `a.x.x` occurs here; the immutable borrow prevents + //~^ immutable borrow occurs here let _y = &mut a.y; //~ ERROR cannot borrow + //~^ mutable borrow occurs here } -//~^ NOTE previous borrow ends here +//~^ NOTE immutable borrow ends here fn main() { copy_after_move(); diff --git a/src/test/compile-fail/borrowck/borrowck-closures-mut-of-imm.rs b/src/test/compile-fail/borrowck/borrowck-closures-mut-of-imm.rs index 40f9be2dd8230..dc2f0e8395f08 100644 --- a/src/test/compile-fail/borrowck/borrowck-closures-mut-of-imm.rs +++ b/src/test/compile-fail/borrowck/borrowck-closures-mut-of-imm.rs @@ -24,7 +24,7 @@ fn a(x: &isize) { //~^ ERROR cannot borrow let c2 = || set(&mut *x); //~^ ERROR cannot borrow - //~| ERROR closure requires unique access + //~| ERROR two closures require unique access to `x` at the same time } fn main() { diff --git a/src/test/compile-fail/borrowck/borrowck-closures-unique.rs b/src/test/compile-fail/borrowck/borrowck-closures-unique.rs index 3646a68f06fd7..1b22dc4d2c6af 100644 --- a/src/test/compile-fail/borrowck/borrowck-closures-unique.rs +++ b/src/test/compile-fail/borrowck/borrowck-closures-unique.rs @@ -39,7 +39,7 @@ fn c(x: &mut isize) { fn d(x: &mut isize) { let c1 = || set(x); - let c2 = || set(x); //~ ERROR closure requires unique access to `x` + let c2 = || set(x); //~ ERROR two closures require unique access to `x` at the same time } fn e(x: &mut isize) { diff --git a/src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs b/src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs index f09e7ffd7e4b7..56cbe0b187867 100644 --- a/src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs +++ b/src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs @@ -109,6 +109,7 @@ fn while_aliased_mut_cond(cond: bool, cond2: bool) { borrow(&*v); //~ ERROR cannot borrow if cond2 { x = &mut v; //~ ERROR cannot borrow + //~^ ERROR cannot borrow } } } diff --git a/src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs b/src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs index 38e0e27a7b98e..f789d44016eb1 100644 --- a/src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs +++ b/src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs @@ -19,6 +19,7 @@ fn main() { match 1 { 1 => { addr = &mut x; } //~^ ERROR cannot borrow `x` as mutable more than once at a time + //~| ERROR cannot borrow `x` as mutable more than once at a time 2 => { addr = &mut x; } //~^ ERROR cannot borrow `x` as mutable more than once at a time _ => { addr = &mut x; } diff --git a/src/test/compile-fail/borrowck/borrowck-report-with-custom-diagnostic.rs b/src/test/compile-fail/borrowck/borrowck-report-with-custom-diagnostic.rs index 2b1ff47ee3d94..3ca8cc431e098 100644 --- a/src/test/compile-fail/borrowck/borrowck-report-with-custom-diagnostic.rs +++ b/src/test/compile-fail/borrowck/borrowck-report-with-custom-diagnostic.rs @@ -13,10 +13,11 @@ fn main() { // Original borrow ends at end of function let mut x = 1; let y = &mut x; - //~^ previous borrow of `x` occurs here; the mutable borrow prevents + //~^ mutable borrow occurs here let z = &x; //~ ERROR cannot borrow + //~^ immutable borrow occurs here } -//~^ NOTE previous borrow ends here +//~^ NOTE mutable borrow ends here fn foo() { match true { @@ -24,10 +25,11 @@ fn foo() { // Original borrow ends at end of match arm let mut x = 1; let y = &x; - //~^ previous borrow of `x` occurs here; the immutable borrow prevents + //~^ immutable borrow occurs here let z = &mut x; //~ ERROR cannot borrow + //~^ mutable borrow occurs here } - //~^ NOTE previous borrow ends here + //~^ NOTE immutable borrow ends here false => () } } @@ -37,8 +39,9 @@ fn bar() { || { let mut x = 1; let y = &mut x; - //~^ previous borrow of `x` occurs here; the mutable borrow prevents + //~^ first mutable borrow occurs here let z = &mut x; //~ ERROR cannot borrow + //~^ second mutable borrow occurs here }; - //~^ NOTE previous borrow ends here + //~^ NOTE first borrow ends here } diff --git a/src/test/compile-fail/closure-wrong-kind.rs b/src/test/compile-fail/closure-wrong-kind.rs index 6792414c36790..a387e4c5ece11 100644 --- a/src/test/compile-fail/closure-wrong-kind.rs +++ b/src/test/compile-fail/closure-wrong-kind.rs @@ -17,6 +17,6 @@ fn bar(_: T) {} fn main() { let x = X; - let closure = |_| foo(x); //~ ERROR E0524 + let closure = |_| foo(x); //~ ERROR E0525 bar(closure); } diff --git a/src/test/compile-fail/coerce-mut.rs b/src/test/compile-fail/coerce-mut.rs index 30c1b66a7b81f..634d12441a120 100644 --- a/src/test/compile-fail/coerce-mut.rs +++ b/src/test/compile-fail/coerce-mut.rs @@ -14,7 +14,7 @@ fn main() { let x = 0; f(&x); //~^ ERROR mismatched types - //~| expected `&mut i32` - //~| found `&_` + //~| expected type `&mut i32` + //~| found type `&_` //~| values differ in mutability } diff --git a/src/test/compile-fail/coercion-slice.rs b/src/test/compile-fail/coercion-slice.rs index bb4d1693af7e3..bd7e6c2a2131d 100644 --- a/src/test/compile-fail/coercion-slice.rs +++ b/src/test/compile-fail/coercion-slice.rs @@ -13,8 +13,7 @@ fn main() { let _: &[i32] = [0]; //~^ ERROR mismatched types - //~| expected `&[i32]` - //~| found `[_; 1]` - //~| expected &-ptr - //~| found array of 1 elements + //~| expected type `&[i32]` + //~| found type `[_; 1]` + //~| expected &-ptr, found array of 1 elements } diff --git a/src/test/compile-fail/cross-borrow-trait.rs b/src/test/compile-fail/cross-borrow-trait.rs index d60fb1d5d1966..ea9a29c0e2ae5 100644 --- a/src/test/compile-fail/cross-borrow-trait.rs +++ b/src/test/compile-fail/cross-borrow-trait.rs @@ -19,8 +19,7 @@ pub fn main() { // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. let x: Box = Box::new(Foo); let _y: &Trait = x; //~ ERROR mismatched types - //~| expected `&Trait` - //~| found `Box` - //~| expected &-ptr - //~| found box + //~| expected type `&Trait` + //~| found type `Box` + //~| expected &-ptr, found box } diff --git a/src/test/compile-fail/default_ty_param_conflict.rs b/src/test/compile-fail/default_ty_param_conflict.rs index 48c5cd1ff7706..4702b504f157d 100644 --- a/src/test/compile-fail/default_ty_param_conflict.rs +++ b/src/test/compile-fail/default_ty_param_conflict.rs @@ -23,6 +23,9 @@ fn main() { // Here, F is instantiated with $0=uint let x = foo(); //~^ ERROR: mismatched types + //~| expected type `usize` + //~| found type `isize` + //~| NOTE: conflicting type parameter defaults `usize` and `isize` //~| NOTE: conflicting type parameter defaults `usize` and `isize` //~| NOTE: ...that was applied to an unconstrained type variable here diff --git a/src/test/compile-fail/default_ty_param_conflict_cross_crate.rs b/src/test/compile-fail/default_ty_param_conflict_cross_crate.rs index fc2c49d65affe..b608c6c99be89 100644 --- a/src/test/compile-fail/default_ty_param_conflict_cross_crate.rs +++ b/src/test/compile-fail/default_ty_param_conflict_cross_crate.rs @@ -24,7 +24,11 @@ fn main() { //~^ NOTE: ...that also applies to the same type variable here meh(foo); - //~^ ERROR: mismatched types: + //~^ ERROR: mismatched types //~| NOTE: conflicting type parameter defaults `bool` and `char` + //~| NOTE: conflicting type parameter defaults `bool` and `char` + //~| a second default is defined on `default_param_test::bleh` //~| NOTE: ...that was applied to an unconstrained type variable here + //~| expected type `bool` + //~| found type `char` } diff --git a/src/test/compile-fail/destructure-trait-ref.rs b/src/test/compile-fail/destructure-trait-ref.rs index 68d9795710245..d0a31fbce91ed 100644 --- a/src/test/compile-fail/destructure-trait-ref.rs +++ b/src/test/compile-fail/destructure-trait-ref.rs @@ -40,20 +40,17 @@ fn main() { // n > m let &&x = &1isize as &T; //~^ ERROR mismatched types - //~| expected `T` - //~| found `&_` - //~| expected trait T - //~| found &-ptr + //~| expected type `T` + //~| found type `&_` + //~| expected trait T, found &-ptr let &&&x = &(&1isize as &T); //~^ ERROR mismatched types - //~| expected `T` - //~| found `&_` - //~| expected trait T - //~| found &-ptr + //~| expected type `T` + //~| found type `&_` + //~| expected trait T, found &-ptr let box box x = box 1isize as Box; //~^ ERROR mismatched types - //~| expected `T` - //~| found `Box<_>` - //~| expected trait T - //~| found box + //~| expected type `T` + //~| found type `Box<_>` + //~| expected trait T, found box } diff --git a/src/test/compile-fail/dst-bad-assign.rs b/src/test/compile-fail/dst-bad-assign.rs index 2d21d0ebc760b..9e71ad2417792 100644 --- a/src/test/compile-fail/dst-bad-assign.rs +++ b/src/test/compile-fail/dst-bad-assign.rs @@ -45,9 +45,8 @@ pub fn main() { let z: Box = Box::new(Bar1 {f: 36}); f5.ptr = Bar1 {f: 36}; //~^ ERROR mismatched types - //~| expected `ToBar` - //~| found `Bar1` - //~| expected trait ToBar - //~| found struct `Bar1` + //~| expected type `ToBar` + //~| found type `Bar1` + //~| expected trait ToBar, found struct `Bar1` //~| ERROR `ToBar: std::marker::Sized` is not satisfied } diff --git a/src/test/compile-fail/dst-bad-coerce4.rs b/src/test/compile-fail/dst-bad-coerce4.rs index c1443bdbb309d..9d4d56cf79190 100644 --- a/src/test/compile-fail/dst-bad-coerce4.rs +++ b/src/test/compile-fail/dst-bad-coerce4.rs @@ -19,8 +19,7 @@ pub fn main() { let f1: &Fat<[isize]> = &Fat { ptr: [1, 2, 3] }; let f2: &Fat<[isize; 3]> = f1; //~^ ERROR mismatched types - //~| expected `&Fat<[isize; 3]>` - //~| found `&Fat<[isize]>` - //~| expected array of 3 elements - //~| found slice + //~| expected type `&Fat<[isize; 3]>` + //~| found type `&Fat<[isize]>` + //~| expected array of 3 elements, found slice } diff --git a/src/test/compile-fail/explicit-self-lifetime-mismatch.rs b/src/test/compile-fail/explicit-self-lifetime-mismatch.rs index 922e58698dd75..b5432fafb1b85 100644 --- a/src/test/compile-fail/explicit-self-lifetime-mismatch.rs +++ b/src/test/compile-fail/explicit-self-lifetime-mismatch.rs @@ -16,12 +16,12 @@ struct Foo<'a,'b> { impl<'a,'b> Foo<'a,'b> { fn bar(self: Foo<'b,'a>) {} //~^ ERROR mismatched types - //~| expected `Foo<'a, 'b>` - //~| found `Foo<'b, 'a>` + //~| expected type `Foo<'a, 'b>` + //~| found type `Foo<'b, 'a>` //~| lifetime mismatch //~| ERROR mismatched types - //~| expected `Foo<'a, 'b>` - //~| found `Foo<'b, 'a>` + //~| expected type `Foo<'a, 'b>` + //~| found type `Foo<'b, 'a>` //~| lifetime mismatch } diff --git a/src/test/compile-fail/extern-main-fn.rs b/src/test/compile-fail/extern-main-fn.rs index 05ce3eefda86c..11f299acefa87 100644 --- a/src/test/compile-fail/extern-main-fn.rs +++ b/src/test/compile-fail/extern-main-fn.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern fn main() {} //~ ERROR: main function expects type +extern fn main() {} //~ ERROR: main function has wrong type diff --git a/src/test/compile-fail/fn-item-type.rs b/src/test/compile-fail/fn-item-type.rs index c90a7113f1b41..6217a9f16b935 100644 --- a/src/test/compile-fail/fn-item-type.rs +++ b/src/test/compile-fail/fn-item-type.rs @@ -22,26 +22,22 @@ impl Foo for T { /* `foo` is still default here */ } fn main() { eq(foo::, bar::); //~^ ERROR mismatched types - //~| expected `fn(isize) -> isize {foo::}` - //~| found `fn(isize) -> isize {bar::}` - //~| expected fn item - //~| found a different fn item + //~| expected type `fn(isize) -> isize {foo::}` + //~| found type `fn(isize) -> isize {bar::}` + //~| expected fn item, found a different fn item eq(foo::, foo::); //~^ ERROR mismatched types - //~| expected `fn(isize) -> isize {foo::}` - //~| found `fn(isize) -> isize {foo::}` + //~| expected u8, found i8 eq(bar::, bar::>); //~^ ERROR mismatched types - //~| expected `fn(isize) -> isize {bar::}` - //~| found `fn(isize) -> isize {bar::>}` - //~| expected struct `std::string::String` - //~| found struct `std::vec::Vec` + //~| expected type `fn(isize) -> isize {bar::}` + //~| found type `fn(isize) -> isize {bar::>}` + //~| expected struct `std::string::String`, found struct `std::vec::Vec` // Make sure we distinguish between trait methods correctly. eq(::foo, ::foo); //~^ ERROR mismatched types - //~| expected `fn() {::foo}` - //~| found `fn() {::foo}` + //~| expected u8, found u16 } diff --git a/src/test/compile-fail/fn-trait-formatting.rs b/src/test/compile-fail/fn-trait-formatting.rs index 8cbfc520ff449..fd140cd1d391a 100644 --- a/src/test/compile-fail/fn-trait-formatting.rs +++ b/src/test/compile-fail/fn-trait-formatting.rs @@ -16,22 +16,19 @@ fn needs_fn(x: F) where F: Fn(isize) -> isize {} fn main() { let _: () = (box |_: isize| {}) as Box; //~^ ERROR mismatched types - //~| expected `()` - //~| found `Box` - //~| expected () - //~| found box + //~| expected type `()` + //~| found type `Box` + //~| expected (), found box let _: () = (box |_: isize, isize| {}) as Box; //~^ ERROR mismatched types - //~| expected `()` - //~| found `Box` - //~| expected () - //~| found box + //~| expected type `()` + //~| found type `Box` + //~| expected (), found box let _: () = (box || -> isize { unimplemented!() }) as Box isize>; //~^ ERROR mismatched types - //~| expected `()` - //~| found `Box isize>` - //~| expected () - //~| found box + //~| expected type `()` + //~| found type `Box isize>` + //~| expected (), found box needs_fn(1); //~^ ERROR : std::ops::Fn<(isize,)>` diff --git a/src/test/compile-fail/fully-qualified-type-name1.rs b/src/test/compile-fail/fully-qualified-type-name1.rs index fb787e8572c20..5ea8ce2264438 100644 --- a/src/test/compile-fail/fully-qualified-type-name1.rs +++ b/src/test/compile-fail/fully-qualified-type-name1.rs @@ -14,8 +14,7 @@ fn main() { let x: Option; x = 5; //~^ ERROR mismatched types - //~| expected `std::option::Option` - //~| found `_` - //~| expected enum `std::option::Option` - //~| found integral variable + //~| expected type `std::option::Option` + //~| found type `_` + //~| expected enum `std::option::Option`, found integral variable } diff --git a/src/test/compile-fail/fully-qualified-type-name2.rs b/src/test/compile-fail/fully-qualified-type-name2.rs index ab542d90800b2..9ba8a11d536be 100644 --- a/src/test/compile-fail/fully-qualified-type-name2.rs +++ b/src/test/compile-fail/fully-qualified-type-name2.rs @@ -21,10 +21,9 @@ mod y { fn bar(x: x::foo) -> y::foo { return x; //~^ ERROR mismatched types - //~| expected `y::foo` - //~| found `x::foo` - //~| expected enum `y::foo` - //~| found enum `x::foo` + //~| expected type `y::foo` + //~| found type `x::foo` + //~| expected enum `y::foo`, found enum `x::foo` } fn main() { diff --git a/src/test/compile-fail/fully-qualified-type-name4.rs b/src/test/compile-fail/fully-qualified-type-name4.rs index 9242849efc746..3c8fde751f123 100644 --- a/src/test/compile-fail/fully-qualified-type-name4.rs +++ b/src/test/compile-fail/fully-qualified-type-name4.rs @@ -15,10 +15,9 @@ use std::option::Option; fn bar(x: usize) -> Option { return x; //~^ ERROR mismatched types - //~| expected `std::option::Option` - //~| found `usize` - //~| expected enum `std::option::Option` - //~| found usize + //~| expected type `std::option::Option` + //~| found type `usize` + //~| expected enum `std::option::Option`, found usize } fn main() { diff --git a/src/test/compile-fail/generic-type-params-name-repr.rs b/src/test/compile-fail/generic-type-params-name-repr.rs index adf9a98a05c2d..71d7cf792e475 100644 --- a/src/test/compile-fail/generic-type-params-name-repr.rs +++ b/src/test/compile-fail/generic-type-params-name-repr.rs @@ -22,46 +22,40 @@ fn main() { // Ensure that the printed type doesn't include the default type params... let _: Foo = (); //~^ ERROR mismatched types - //~| expected `Foo` - //~| found `()` - //~| expected struct `Foo` - //~| found () + //~| expected type `Foo` + //~| found type `()` + //~| expected struct `Foo`, found () // ...even when they're present, but the same types as the defaults. let _: Foo = (); //~^ ERROR mismatched types - //~| expected `Foo` - //~| found `()` - //~| expected struct `Foo` - //~| found () + //~| expected type `Foo` + //~| found type `()` + //~| expected struct `Foo`, found () // Including cases where the default is using previous type params. let _: HashMap = (); //~^ ERROR mismatched types - //~| expected `HashMap` - //~| found `()` - //~| expected struct `HashMap` - //~| found () + //~| expected type `HashMap` + //~| found type `()` + //~| expected struct `HashMap`, found () let _: HashMap> = (); //~^ ERROR mismatched types - //~| expected `HashMap` - //~| found `()` - //~| expected struct `HashMap` - //~| found () + //~| expected type `HashMap` + //~| found type `()` + //~| expected struct `HashMap`, found () // But not when there's a different type in between. let _: Foo = (); //~^ ERROR mismatched types - //~| expected `Foo` - //~| found `()` - //~| expected struct `Foo` - //~| found () + //~| expected type `Foo` + //~| found type `()` + //~| expected struct `Foo`, found () // And don't print <> at all when there's just defaults. let _: Foo = (); //~^ ERROR mismatched types - //~| expected `Foo` - //~| found `()` - //~| expected struct `Foo` - //~| found () + //~| expected type `Foo` + //~| found type `()` + //~| expected struct `Foo`, found () } diff --git a/src/test/compile-fail/if-branch-types.rs b/src/test/compile-fail/if-branch-types.rs index 2c730531b823a..ca9803f66b20d 100644 --- a/src/test/compile-fail/if-branch-types.rs +++ b/src/test/compile-fail/if-branch-types.rs @@ -11,6 +11,5 @@ fn main() { let x = if true { 10i32 } else { 10u32 }; //~^ ERROR if and else have incompatible types - //~| expected `i32` - //~| found `u32` + //~| expected i32, found u32 } diff --git a/src/test/compile-fail/if-let-arm-types.rs b/src/test/compile-fail/if-let-arm-types.rs index d179ec015d231..c7b1e1a62c209 100644 --- a/src/test/compile-fail/if-let-arm-types.rs +++ b/src/test/compile-fail/if-let-arm-types.rs @@ -10,6 +10,9 @@ fn main() { if let Some(b) = None { //~ ERROR: `if let` arms have incompatible types + //~^ expected (), found integral variable + //~| expected type `()` + //~| found type `_` () } else { //~ NOTE: `if let` arm with an incompatible type 1 diff --git a/src/test/compile-fail/if-without-else-result.rs b/src/test/compile-fail/if-without-else-result.rs index a9567f4272f50..e8aa1f70ea1dc 100644 --- a/src/test/compile-fail/if-without-else-result.rs +++ b/src/test/compile-fail/if-without-else-result.rs @@ -11,9 +11,8 @@ fn main() { let a = if true { true }; //~^ ERROR if may be missing an else clause - //~| expected `()` - //~| found `bool` - //~| expected () - //~| found bool + //~| expected type `()` + //~| found type `bool` + //~| expected (), found bool println!("{}", a); } diff --git a/src/test/compile-fail/integer-literal-suffix-inference.rs b/src/test/compile-fail/integer-literal-suffix-inference.rs index a01db18a34a7f..7a850d90a8747 100644 --- a/src/test/compile-fail/integer-literal-suffix-inference.rs +++ b/src/test/compile-fail/integer-literal-suffix-inference.rs @@ -41,168 +41,132 @@ fn main() { id_i8(a8); // ok id_i8(a16); //~^ ERROR mismatched types - //~| expected `i8` - //~| found `i16` + //~| expected i8, found i16 id_i8(a32); //~^ ERROR mismatched types - //~| expected `i8` - //~| found `i32` + //~| expected i8, found i32 id_i8(a64); //~^ ERROR mismatched types - //~| expected `i8` - //~| found `i64` + //~| expected i8, found i64 id_i16(a8); //~^ ERROR mismatched types - //~| expected `i16` - //~| found `i8` + //~| expected i16, found i8 id_i16(a16); // ok id_i16(a32); //~^ ERROR mismatched types - //~| expected `i16` - //~| found `i32` + //~| expected i16, found i32 id_i16(a64); //~^ ERROR mismatched types - //~| expected `i16` - //~| found `i64` + //~| expected i16, found i64 id_i32(a8); //~^ ERROR mismatched types - //~| expected `i32` - //~| found `i8` + //~| expected i32, found i8 id_i32(a16); //~^ ERROR mismatched types - //~| expected `i32` - //~| found `i16` + //~| expected i32, found i16 id_i32(a32); // ok id_i32(a64); //~^ ERROR mismatched types - //~| expected `i32` - //~| found `i64` + //~| expected i32, found i64 id_i64(a8); //~^ ERROR mismatched types - //~| expected `i64` - //~| found `i8` + //~| expected i64, found i8 id_i64(a16); //~^ ERROR mismatched types - //~| expected `i64` - //~| found `i16` + //~| expected i64, found i16 id_i64(a32); //~^ ERROR mismatched types - //~| expected `i64` - //~| found `i32` + //~| expected i64, found i32 id_i64(a64); // ok id_i8(c8); // ok id_i8(c16); //~^ ERROR mismatched types - //~| expected `i8` - //~| found `i16` + //~| expected i8, found i16 id_i8(c32); //~^ ERROR mismatched types - //~| expected `i8` - //~| found `i32` + //~| expected i8, found i32 id_i8(c64); //~^ ERROR mismatched types - //~| expected `i8` - //~| found `i64` + //~| expected i8, found i64 id_i16(c8); //~^ ERROR mismatched types - //~| expected `i16` - //~| found `i8` + //~| expected i16, found i8 id_i16(c16); // ok id_i16(c32); //~^ ERROR mismatched types - //~| expected `i16` - //~| found `i32` + //~| expected i16, found i32 id_i16(c64); //~^ ERROR mismatched types - //~| expected `i16` - //~| found `i64` + //~| expected i16, found i64 id_i32(c8); //~^ ERROR mismatched types - //~| expected `i32` - //~| found `i8` + //~| expected i32, found i8 id_i32(c16); //~^ ERROR mismatched types - //~| expected `i32` - //~| found `i16` + //~| expected i32, found i16 id_i32(c32); // ok id_i32(c64); //~^ ERROR mismatched types - //~| expected `i32` - //~| found `i64` + //~| expected i32, found i64 id_i64(a8); //~^ ERROR mismatched types - //~| expected `i64` - //~| found `i8` + //~| expected i64, found i8 id_i64(a16); //~^ ERROR mismatched types - //~| expected `i64` - //~| found `i16` + //~| expected i64, found i16 id_i64(a32); //~^ ERROR mismatched types - //~| expected `i64` - //~| found `i32` + //~| expected i64, found i32 id_i64(a64); // ok id_u8(b8); // ok id_u8(b16); //~^ ERROR mismatched types - //~| expected `u8` - //~| found `u16` + //~| expected u8, found u16 id_u8(b32); //~^ ERROR mismatched types - //~| expected `u8` - //~| found `u32` + //~| expected u8, found u32 id_u8(b64); //~^ ERROR mismatched types - //~| expected `u8` - //~| found `u64` + //~| expected u8, found u64 id_u16(b8); //~^ ERROR mismatched types - //~| expected `u16` - //~| found `u8` + //~| expected u16, found u8 id_u16(b16); // ok id_u16(b32); //~^ ERROR mismatched types - //~| expected `u16` - //~| found `u32` + //~| expected u16, found u32 id_u16(b64); //~^ ERROR mismatched types - //~| expected `u16` - //~| found `u64` + //~| expected u16, found u64 id_u32(b8); //~^ ERROR mismatched types - //~| expected `u32` - //~| found `u8` + //~| expected u32, found u8 id_u32(b16); //~^ ERROR mismatched types - //~| expected `u32` - //~| found `u16` + //~| expected u32, found u16 id_u32(b32); // ok id_u32(b64); //~^ ERROR mismatched types - //~| expected `u32` - //~| found `u64` + //~| expected u32, found u64 id_u64(b8); //~^ ERROR mismatched types - //~| expected `u64` - //~| found `u8` + //~| expected u64, found u8 id_u64(b16); //~^ ERROR mismatched types - //~| expected `u64` - //~| found `u16` + //~| expected u64, found u16 id_u64(b32); //~^ ERROR mismatched types - //~| expected `u64` - //~| found `u32` + //~| expected u64, found u32 id_u64(b64); // ok } diff --git a/src/test/compile-fail/integral-variable-unification-error.rs b/src/test/compile-fail/integral-variable-unification-error.rs index 3374f715917c2..99f2d25166891 100644 --- a/src/test/compile-fail/integral-variable-unification-error.rs +++ b/src/test/compile-fail/integral-variable-unification-error.rs @@ -12,8 +12,7 @@ fn main() { let mut x = 2; x = 5.0; //~^ ERROR mismatched types - //~| expected `_` - //~| found `_` - //~| expected integral variable - //~| found floating-point variable + //~| expected type `_` + //~| found type `_` + //~| expected integral variable, found floating-point variable } diff --git a/src/test/compile-fail/issue-10176.rs b/src/test/compile-fail/issue-10176.rs index 6e84e777898b6..434b795ff31f5 100644 --- a/src/test/compile-fail/issue-10176.rs +++ b/src/test/compile-fail/issue-10176.rs @@ -11,10 +11,9 @@ fn f() -> isize { (return 1, return 2) //~^ ERROR mismatched types -//~| expected `isize` -//~| found `(_, _)` -//~| expected isize -//~| found tuple +//~| expected type `isize` +//~| found type `(_, _)` +//~| expected isize, found tuple } fn main() {} diff --git a/src/test/compile-fail/issue-11319.rs b/src/test/compile-fail/issue-11319.rs index d3e44b71b1c89..8242fa1c2e979 100644 --- a/src/test/compile-fail/issue-11319.rs +++ b/src/test/compile-fail/issue-11319.rs @@ -10,11 +10,10 @@ fn main() { match Some(10) { - //~^ ERROR match arms have incompatible types: - //~| expected `bool` - //~| found `()` - //~| expected bool - //~| found () + //~^ ERROR match arms have incompatible types + //~| expected type `bool` + //~| found type `()` + //~| expected bool, found () Some(5) => false, Some(2) => true, None => (), //~ NOTE match arm with an incompatible type diff --git a/src/test/compile-fail/issue-12997-2.rs b/src/test/compile-fail/issue-12997-2.rs index 8b467c2ba11f9..436d9e91dc72f 100644 --- a/src/test/compile-fail/issue-12997-2.rs +++ b/src/test/compile-fail/issue-12997-2.rs @@ -15,7 +15,6 @@ #[bench] fn bar(x: isize) { } //~^ ERROR mismatched types -//~| expected `fn(&mut __test::test::Bencher)` -//~| found `fn(isize) {bar}` -//~| expected &-ptr -//~| found isize +//~| expected type `fn(&mut __test::test::Bencher)` +//~| found type `fn(isize) {bar}` +//~| expected &-ptr, found isize diff --git a/src/test/compile-fail/issue-13359.rs b/src/test/compile-fail/issue-13359.rs index 775412a12ca6a..e33859e8c19a3 100644 --- a/src/test/compile-fail/issue-13359.rs +++ b/src/test/compile-fail/issue-13359.rs @@ -15,11 +15,9 @@ fn bar(_s: u32) { } fn main() { foo(1*(1 as isize)); //~^ ERROR mismatched types - //~| expected `i16` - //~| found `isize` + //~| expected i16, found isize bar(1*(1 as usize)); //~^ ERROR mismatched types - //~| expected `u32` - //~| found `usize` + //~| expected u32, found usize } diff --git a/src/test/compile-fail/issue-13466.rs b/src/test/compile-fail/issue-13466.rs index d2c8b679ff69f..17b96411603ef 100644 --- a/src/test/compile-fail/issue-13466.rs +++ b/src/test/compile-fail/issue-13466.rs @@ -17,16 +17,14 @@ pub fn main() { let _x: usize = match Some(1) { Ok(u) => u, //~^ ERROR mismatched types - //~| expected `std::option::Option<_>` - //~| found `std::result::Result<_, _>` - //~| expected enum `std::option::Option` - //~| found enum `std::result::Result` + //~| expected type `std::option::Option<_>` + //~| found type `std::result::Result<_, _>` + //~| expected enum `std::option::Option`, found enum `std::result::Result` Err(e) => panic!(e) //~^ ERROR mismatched types - //~| expected `std::option::Option<_>` - //~| found `std::result::Result<_, _>` - //~| expected enum `std::option::Option` - //~| found enum `std::result::Result` + //~| expected type `std::option::Option<_>` + //~| found type `std::result::Result<_, _>` + //~| expected enum `std::option::Option`, found enum `std::result::Result` }; } diff --git a/src/test/compile-fail/issue-13482-2.rs b/src/test/compile-fail/issue-13482-2.rs index e1fe2d06993d5..fe03373a45d9f 100644 --- a/src/test/compile-fail/issue-13482-2.rs +++ b/src/test/compile-fail/issue-13482-2.rs @@ -17,10 +17,9 @@ fn main() { let y = match x { [] => None, //~^ ERROR mismatched types -//~| expected `[_#1i; 2]` -//~| found `[_#7t; 0]` -//~| expected an array with a fixed size of 2 elements -//~| found one with 0 elements +//~| expected type `[_#1i; 2]` +//~| found type `[_#7t; 0]` +//~| expected an array with a fixed size of 2 elements, found one with 0 elements [a,_] => Some(a) }; } diff --git a/src/test/compile-fail/issue-13482.rs b/src/test/compile-fail/issue-13482.rs index 8d98fe313349b..7ed7f5898b1b7 100644 --- a/src/test/compile-fail/issue-13482.rs +++ b/src/test/compile-fail/issue-13482.rs @@ -15,8 +15,8 @@ fn main() { let y = match x { [] => None, //~^ ERROR mismatched types - //~| expected `[_; 2]` - //~| found `[_; 0]` + //~| expected type `[_; 2]` + //~| found type `[_; 0]` //~| expected an array with a fixed size of 2 elements [a,_] => Some(a) }; diff --git a/src/test/compile-fail/issue-13624.rs b/src/test/compile-fail/issue-13624.rs index 2a5805790a742..e4ed87c3cb0cd 100644 --- a/src/test/compile-fail/issue-13624.rs +++ b/src/test/compile-fail/issue-13624.rs @@ -16,10 +16,9 @@ mod a { pub fn get_enum_struct_variant() -> () { Enum::EnumStructVariant { x: 1, y: 2, z: 3 } //~^ ERROR mismatched types - //~| expected `()` - //~| found `a::Enum` - //~| expected () - //~| found enum `a::Enum` + //~| expected type `()` + //~| found type `a::Enum` + //~| expected (), found enum `a::Enum` } } @@ -32,10 +31,9 @@ mod b { match enum_struct_variant { a::Enum::EnumStructVariant { x, y, z } => { //~^ ERROR mismatched types - //~| expected `()` - //~| found `a::Enum` - //~| expected () - // found enum `a::Enum` + //~| expected type `()` + //~| found type `a::Enum` + //~| expected (), found enum `a::Enum` } } } diff --git a/src/test/compile-fail/issue-14091.rs b/src/test/compile-fail/issue-14091.rs index 3ceb465cb4b23..ccaeeab8b4789 100644 --- a/src/test/compile-fail/issue-14091.rs +++ b/src/test/compile-fail/issue-14091.rs @@ -9,9 +9,8 @@ // except according to those terms. // error-pattern:mismatched types -// error-pattern:expected `bool` -// error-pattern:found `_` -// error-pattern:expected bool -// error-pattern:found integral variable +// error-pattern:expected bool, found integral variable +// error-pattern:expected type `bool` +// error-pattern:found type `_` fn main(){assert!(1,1);} diff --git a/src/test/compile-fail/issue-14541.rs b/src/test/compile-fail/issue-14541.rs index deb8f00cd01c9..84c600d2201e3 100644 --- a/src/test/compile-fail/issue-14541.rs +++ b/src/test/compile-fail/issue-14541.rs @@ -14,10 +14,9 @@ struct vec3 { y: f32, z: f32 } fn make(v: vec2) { let vec3 { y: _, z: _ } = v; //~^ ERROR mismatched types - //~| expected `vec2` - //~| found `vec3` - //~| expected struct `vec2` - //~| found struct `vec3` + //~| expected type `vec2` + //~| found type `vec3` + //~| expected struct `vec2`, found struct `vec3` } fn main() { } diff --git a/src/test/compile-fail/issue-15783.rs b/src/test/compile-fail/issue-15783.rs index 9a139021e4c6d..37a2f1582bf08 100644 --- a/src/test/compile-fail/issue-15783.rs +++ b/src/test/compile-fail/issue-15783.rs @@ -17,9 +17,8 @@ fn main() { let x = Some(&[name]); let msg = foo(x); //~^ ERROR mismatched types -//~| expected `std::option::Option<&[&str]>` -//~| found `std::option::Option<&[&str; 1]>` -//~| expected slice -//~| found array of 1 elements +//~| expected type `std::option::Option<&[&str]>` +//~| found type `std::option::Option<&[&str; 1]>` +//~| expected slice, found array of 1 elements assert_eq!(msg, 3); } diff --git a/src/test/compile-fail/issue-15896.rs b/src/test/compile-fail/issue-15896.rs index 7381ade263b20..35ef9ba2b4bea 100644 --- a/src/test/compile-fail/issue-15896.rs +++ b/src/test/compile-fail/issue-15896.rs @@ -20,10 +20,9 @@ fn main() { E::B( Tau{t: x}, //~^ ERROR mismatched types - //~| expected `main::R` - //~| found `main::Tau` - //~| expected enum `main::R` - //~| found struct `main::Tau` + //~| expected type `main::R` + //~| found type `main::Tau` + //~| expected enum `main::R`, found struct `main::Tau` _) => x, }; } diff --git a/src/test/compile-fail/issue-16338.rs b/src/test/compile-fail/issue-16338.rs index 30775a958b57d..da6d081a7acb5 100644 --- a/src/test/compile-fail/issue-16338.rs +++ b/src/test/compile-fail/issue-16338.rs @@ -13,8 +13,7 @@ use std::raw::Slice; fn main() { let Slice { data: data, len: len } = "foo"; //~^ ERROR mismatched types - //~| expected `&str` - //~| found `std::raw::Slice<_>` - //~| expected &-ptr - //~| found struct `std::raw::Slice` + //~| expected type `&str` + //~| found type `std::raw::Slice<_>` + //~| expected &-ptr, found struct `std::raw::Slice` } diff --git a/src/test/compile-fail/issue-16401.rs b/src/test/compile-fail/issue-16401.rs index a90f9fe26e48c..df272a71cee4f 100644 --- a/src/test/compile-fail/issue-16401.rs +++ b/src/test/compile-fail/issue-16401.rs @@ -14,10 +14,9 @@ fn main() { match () { Slice { data: data, len: len } => (), //~^ ERROR mismatched types - //~| expected `()` - //~| found `std::raw::Slice<_>` - //~| expected () - //~| found struct `std::raw::Slice` + //~| expected type `()` + //~| found type `std::raw::Slice<_>` + //~| expected (), found struct `std::raw::Slice` _ => unreachable!() } } diff --git a/src/test/compile-fail/issue-17033.rs b/src/test/compile-fail/issue-17033.rs index 6010e206920e5..f0fe01b415970 100644 --- a/src/test/compile-fail/issue-17033.rs +++ b/src/test/compile-fail/issue-17033.rs @@ -12,10 +12,9 @@ fn f<'r>(p: &'r mut fn(p: &mut ())) { (*p)(()) //~ ERROR mismatched types - //~| expected `&mut ()` - //~| found `()` - //~| expected &-ptr - //~| found () + //~| expected type `&mut ()` + //~| found type `()` + //~| expected &-ptr, found () } fn main() {} diff --git a/src/test/compile-fail/issue-17263.rs b/src/test/compile-fail/issue-17263.rs index 2320bc02baf5e..063afe285fad3 100644 --- a/src/test/compile-fail/issue-17263.rs +++ b/src/test/compile-fail/issue-17263.rs @@ -15,13 +15,15 @@ struct Foo { a: isize, b: isize } fn main() { let mut x: Box<_> = box Foo { a: 1, b: 2 }; let (a, b) = (&mut x.a, &mut x.b); - //~^ ERROR cannot borrow `x` (here through borrowing `x.b`) as mutable more than once at a time - //~^^ NOTE previous borrow of `x` occurs here (through borrowing `x.a`) + //~^ ERROR cannot borrow `x` (via `x.b`) as mutable more than once at a time + //~| NOTE first mutable borrow occurs here (via `x.a`) + //~| NOTE second mutable borrow occurs here (via `x.b`) let mut foo: Box<_> = box Foo { a: 1, b: 2 }; let (c, d) = (&mut foo.a, &foo.b); - //~^ ERROR cannot borrow `foo` (here through borrowing `foo.b`) as immutable - //~^^ NOTE previous borrow of `foo` occurs here (through borrowing `foo.a`) + //~^ ERROR cannot borrow `foo` (via `foo.b`) as immutable + //~| NOTE mutable borrow occurs here (via `foo.a`) + //~| NOTE immutable borrow occurs here (via `foo.b`) } -//~^ NOTE previous borrow ends here -//~^^ NOTE previous borrow ends here +//~^ NOTE first borrow ends here +//~^^ NOTE mutable borrow ends here diff --git a/src/test/compile-fail/issue-17283.rs b/src/test/compile-fail/issue-17283.rs index c7d6443663241..98208bcfdbdee 100644 --- a/src/test/compile-fail/issue-17283.rs +++ b/src/test/compile-fail/issue-17283.rs @@ -24,28 +24,25 @@ fn main() { // `x { ... }` should not be interpreted as a struct literal here if x = x { //~^ ERROR mismatched types - //~| expected `bool` - //~| found `()` - //~| expected bool - //~| found () + //~| expected type `bool` + //~| found type `()` + //~| expected bool, found () println!("{}", x); } // Explicit parentheses on the left should match behavior of above if (x = x) { //~^ ERROR mismatched types - //~| expected `bool` - //~| found `()` - //~| expected bool - //~| found () + //~| expected type `bool` + //~| found type `()` + //~| expected bool, found () println!("{}", x); } // The struct literal interpretation is fine with explicit parentheses on the right if y = (Foo { foo: x }) { //~^ ERROR mismatched types - //~| expected `bool` - //~| found `()` - //~| expected bool - //~| found () + //~| expected type `bool` + //~| found type `()` + //~| expected bool, found () println!("{}", x); } } diff --git a/src/test/compile-fail/issue-17728.rs b/src/test/compile-fail/issue-17728.rs index 787eb7a3b8878..f508d7123d88f 100644 --- a/src/test/compile-fail/issue-17728.rs +++ b/src/test/compile-fail/issue-17728.rs @@ -108,6 +108,9 @@ impl Debug for Player { fn str_to_direction(to_parse: &str) -> RoomDirection { match to_parse { //~ ERROR match arms have incompatible types + //~^ expected enum `RoomDirection`, found enum `std::option::Option` + //~| expected type `RoomDirection` + //~| found type `std::option::Option<_>` "w" | "west" => RoomDirection::West, "e" | "east" => RoomDirection::East, "n" | "north" => RoomDirection::North, diff --git a/src/test/compile-fail/issue-17740.rs b/src/test/compile-fail/issue-17740.rs index 4381bf22e2ace..6b9294b2038f1 100644 --- a/src/test/compile-fail/issue-17740.rs +++ b/src/test/compile-fail/issue-17740.rs @@ -15,12 +15,12 @@ struct Foo<'a> { impl <'a> Foo<'a>{ fn bar(self: &mut Foo) { //~^ mismatched types - //~| expected `&mut Foo<'a>` - //~| found `&mut Foo<'_>` + //~| expected type `&mut Foo<'a>` + //~| found type `&mut Foo<'_>` //~| lifetime mismatch //~| mismatched types - //~| expected `&mut Foo<'a>` - //~| found `&mut Foo<'_>` + //~| expected type `&mut Foo<'a>` + //~| found type `&mut Foo<'_>` //~| lifetime mismatch } } diff --git a/src/test/compile-fail/issue-19109.rs b/src/test/compile-fail/issue-19109.rs index 1ffffa9fc748e..580684e2e140b 100644 --- a/src/test/compile-fail/issue-19109.rs +++ b/src/test/compile-fail/issue-19109.rs @@ -12,11 +12,10 @@ trait Trait { } fn function(t: &mut Trait) { t as *mut Trait - //~^ ERROR: mismatched types: - //~| expected `()`, - //~| found `*mut Trait` - //~| (expected (), - //~| found *-ptr) [E0308] + //~^ ERROR: mismatched types + //~| NOTE: expected type `()` + //~| NOTE: found type `*mut Trait` + //~| NOTE: expected (), found *-ptr } fn main() { } diff --git a/src/test/compile-fail/issue-19991.rs b/src/test/compile-fail/issue-19991.rs index 6c9b0004f7754..b368daaaf587c 100644 --- a/src/test/compile-fail/issue-19991.rs +++ b/src/test/compile-fail/issue-19991.rs @@ -13,10 +13,9 @@ fn main() { if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause - //~| expected `()` - //~| found `_` - //~| expected () - //~| found integral variable + //~| expected type `()` + //~| found type `_` + //~| expected (), found integral variable 765 }; } diff --git a/src/test/compile-fail/issue-24036.rs b/src/test/compile-fail/issue-24036.rs index 06b058cbfe179..ac7e0f2e9a867 100644 --- a/src/test/compile-fail/issue-24036.rs +++ b/src/test/compile-fail/issue-24036.rs @@ -14,6 +14,9 @@ fn closure_to_loc() { //~^ ERROR mismatched types //~| NOTE no two closures, even if identical, have the same type //~| HELP consider boxing your closure and/or using it as a trait object + //~| expected closure, found a different closure + //~| expected type `[closure + //~| found type `[closure } fn closure_from_match() { @@ -26,6 +29,9 @@ fn closure_from_match() { //~^^^^^^ ERROR match arms have incompatible types //~| NOTE no two closures, even if identical, have the same type //~| HELP consider boxing your closure and/or using it as a trait object + //~| expected closure, found a different closure + //~| expected type `[closure + //~| found type `[closure } fn main() { } diff --git a/src/test/compile-fail/issue-24357.rs b/src/test/compile-fail/issue-24357.rs index f193a07b85af9..5d6b989fc968a 100644 --- a/src/test/compile-fail/issue-24357.rs +++ b/src/test/compile-fail/issue-24357.rs @@ -12,7 +12,9 @@ struct NoCopy; fn main() { let x = NoCopy; let f = move || { let y = x; }; - //~^ NOTE `x` moved into closure environment here because it has type `NoCopy` + //~^ value moved (into closure) here let z = x; //~^ ERROR use of moved value: `x` + //~| value used here after move + //~| move occurs because `x` has type `NoCopy` } diff --git a/src/test/compile-fail/issue-24446.rs b/src/test/compile-fail/issue-24446.rs index a2831fd2b5ac8..cbeac77479811 100644 --- a/src/test/compile-fail/issue-24446.rs +++ b/src/test/compile-fail/issue-24446.rs @@ -10,7 +10,7 @@ fn main() { static foo: Fn() -> u32 = || -> u32 { - //~^ ERROR: mismatched types: + //~^ ERROR: mismatched types 0 }; } diff --git a/src/test/compile-fail/issue-26480.rs b/src/test/compile-fail/issue-26480.rs index 23e4ffb1f3076..adcf8484f7828 100644 --- a/src/test/compile-fail/issue-26480.rs +++ b/src/test/compile-fail/issue-26480.rs @@ -25,6 +25,7 @@ macro_rules! write { write(stdout, $arr.as_ptr() as *const i8, $arr.len() * size_of($arr[0])); //~^ ERROR mismatched types + //~| expected u64, found usize } }} } diff --git a/src/test/compile-fail/issue-27008.rs b/src/test/compile-fail/issue-27008.rs index 2a4b98563ab9f..bdcbaf09177fe 100644 --- a/src/test/compile-fail/issue-27008.rs +++ b/src/test/compile-fail/issue-27008.rs @@ -13,9 +13,8 @@ struct S; fn main() { let b = [0; S]; //~^ ERROR mismatched types - //~| expected `usize` - //~| found `S` - //~| expected usize - //~| found struct `S` + //~| expected type `usize` + //~| found type `S` + //~| expected usize, found struct `S` //~| ERROR expected positive integer for repeat count, found struct } diff --git a/src/test/compile-fail/issue-29084.rs b/src/test/compile-fail/issue-29084.rs index 78913e759a1cc..00d2969a0f67d 100644 --- a/src/test/compile-fail/issue-29084.rs +++ b/src/test/compile-fail/issue-29084.rs @@ -13,10 +13,13 @@ macro_rules! foo { fn bar(d: u8) { } bar(&mut $d); //~^ ERROR mismatched types + //~| expected u8, found &-ptr + //~| expected type `u8` + //~| found type `&mut u8` }} } fn main() { foo!(0u8); - //~^ NOTE in this expansion of foo! + //~^ in this expansion of foo! } diff --git a/src/test/compile-fail/issue-2951.rs b/src/test/compile-fail/issue-2951.rs index d0781b5658087..11ff7ab2476b9 100644 --- a/src/test/compile-fail/issue-2951.rs +++ b/src/test/compile-fail/issue-2951.rs @@ -12,10 +12,9 @@ fn foo(x: T, y: U) { let mut xx = x; xx = y; //~^ ERROR mismatched types - //~| expected `T` - //~| found `U` - //~| expected type parameter - //~| found a different type parameter + //~| expected type `T` + //~| found type `U` + //~| expected type parameter, found a different type parameter } fn main() { diff --git a/src/test/compile-fail/issue-3477.rs b/src/test/compile-fail/issue-3477.rs index 43ef1b59ccf27..0bad7372a12d9 100644 --- a/src/test/compile-fail/issue-3477.rs +++ b/src/test/compile-fail/issue-3477.rs @@ -11,6 +11,5 @@ fn main() { let _p: char = 100; //~^ ERROR mismatched types - //~| expected `char` - //~| found `u8` + //~| expected char, found u8 } diff --git a/src/test/compile-fail/issue-3680.rs b/src/test/compile-fail/issue-3680.rs index fc918c278ef5d..e698e6da5294e 100644 --- a/src/test/compile-fail/issue-3680.rs +++ b/src/test/compile-fail/issue-3680.rs @@ -12,9 +12,8 @@ fn main() { match None { Err(_) => () //~^ ERROR mismatched types - //~| expected `std::option::Option<_>` - //~| found `std::result::Result<_, _>` - //~| expected enum `std::option::Option` - //~| found enum `std::result::Result` + //~| expected type `std::option::Option<_>` + //~| found type `std::result::Result<_, _>` + //~| expected enum `std::option::Option`, found enum `std::result::Result` } } diff --git a/src/test/compile-fail/issue-4201.rs b/src/test/compile-fail/issue-4201.rs index b5af1f03b635b..58423341cc6f0 100644 --- a/src/test/compile-fail/issue-4201.rs +++ b/src/test/compile-fail/issue-4201.rs @@ -13,10 +13,9 @@ fn main() { 0 } else if false { //~^ ERROR if may be missing an else clause -//~| expected `()` -//~| found `_` -//~| expected () -//~| found integral variable +//~| expected type `()` +//~| found type `_` +//~| expected (), found integral variable 1 }; } diff --git a/src/test/compile-fail/issue-4517.rs b/src/test/compile-fail/issue-4517.rs index a1804b5a2689d..fbd8972cbfaa6 100644 --- a/src/test/compile-fail/issue-4517.rs +++ b/src/test/compile-fail/issue-4517.rs @@ -14,8 +14,7 @@ fn main() { let foo: [u8; 4] = [1; 4]; bar(foo); //~^ ERROR mismatched types - //~| expected `usize` - //~| found `[u8; 4]` - //~| expected usize - //~| found array of 4 elements + //~| expected type `usize` + //~| found type `[u8; 4]` + //~| expected usize, found array of 4 elements } diff --git a/src/test/compile-fail/issue-4968.rs b/src/test/compile-fail/issue-4968.rs index e7cd20f38a1d2..7c0905873df89 100644 --- a/src/test/compile-fail/issue-4968.rs +++ b/src/test/compile-fail/issue-4968.rs @@ -14,8 +14,7 @@ const A: (isize,isize) = (4,2); fn main() { match 42 { A => () } //~^ ERROR mismatched types - //~| expected `_` - //~| found `(isize, isize)` - //~| expected integral variable - //~| found tuple + //~| expected type `_` + //~| found type `(isize, isize)` + //~| expected integral variable, found tuple } diff --git a/src/test/compile-fail/issue-5100.rs b/src/test/compile-fail/issue-5100.rs index 304b6f185fe36..9e78b7b947f98 100644 --- a/src/test/compile-fail/issue-5100.rs +++ b/src/test/compile-fail/issue-5100.rs @@ -16,48 +16,43 @@ enum A { B, C } fn main() { match (true, false) { A::B => (), -//~^ ERROR mismatched types: -//~| expected `(bool, bool)` -//~| found `A` -//~| expected tuple -//~| found enum `A` +//~^ ERROR mismatched types +//~| expected type `(bool, bool)` +//~| found type `A` +//~| expected tuple, found enum `A` _ => () } match (true, false) { (true, false, false) => () //~^ ERROR mismatched types -//~| expected `(bool, bool)` -//~| found `(_, _, _)` -//~| expected a tuple with 2 elements -//~| found one with 3 elements +//~| expected type `(bool, bool)` +//~| found type `(_, _, _)` +//~| expected a tuple with 2 elements, found one with 3 elements } match (true, false) { (true, false, false) => () //~^ ERROR mismatched types -//~| expected `(bool, bool)` -//~| found `(_, _, _)` -//~| expected a tuple with 2 elements -//~| found one with 3 elements +//~| expected type `(bool, bool)` +//~| found type `(_, _, _)` +//~| expected a tuple with 2 elements, found one with 3 elements } match (true, false) { box (true, false) => () //~^ ERROR mismatched types -//~| expected `(bool, bool)` -//~| found `Box<_>` -//~| expected tuple -//~| found box +//~| expected type `(bool, bool)` +//~| found type `Box<_>` +//~| expected tuple, found box } match (true, false) { &(true, false) => () //~^ ERROR mismatched types -//~| expected `(bool, bool)` -//~| found `&_` -//~| expected tuple -//~| found &-ptr +//~| expected type `(bool, bool)` +//~| found type `&_` +//~| expected tuple, found &-ptr } @@ -69,6 +64,5 @@ fn main() { // Make sure none of the errors above were fatal let x: char = true; //~ ERROR mismatched types - //~| expected `char` - //~| found `bool` + //~| expected char, found bool } diff --git a/src/test/compile-fail/issue-5358-1.rs b/src/test/compile-fail/issue-5358-1.rs index 32702d3e2f6fe..d8aad54fd3ee9 100644 --- a/src/test/compile-fail/issue-5358-1.rs +++ b/src/test/compile-fail/issue-5358-1.rs @@ -15,10 +15,9 @@ fn main() { match S(Either::Left(5)) { Either::Right(_) => {} //~^ ERROR mismatched types - //~| expected `S` - //~| found `Either<_, _>` - //~| expected struct `S` - //~| found enum `Either` + //~| expected type `S` + //~| found type `Either<_, _>` + //~| expected struct `S`, found enum `Either` _ => {} } } diff --git a/src/test/compile-fail/issue-5500.rs b/src/test/compile-fail/issue-5500.rs index 565634191be9a..cacbf7656def2 100644 --- a/src/test/compile-fail/issue-5500.rs +++ b/src/test/compile-fail/issue-5500.rs @@ -11,8 +11,7 @@ fn main() { &panic!() //~^ ERROR mismatched types - //~| expected `()` - //~| found `&_` - //~| expected () - //~| found &-ptr + //~| expected type `()` + //~| found type `&_` + //~| expected (), found &-ptr } diff --git a/src/test/compile-fail/issue-7061.rs b/src/test/compile-fail/issue-7061.rs index e261249bc998e..1519d71dd3be2 100644 --- a/src/test/compile-fail/issue-7061.rs +++ b/src/test/compile-fail/issue-7061.rs @@ -13,10 +13,9 @@ struct BarStruct; impl<'a> BarStruct { fn foo(&'a mut self) -> Box { self } //~^ ERROR mismatched types - //~| expected `Box` - //~| found `&'a mut BarStruct` - //~| expected box - //~| found &-ptr + //~| expected type `Box` + //~| found type `&'a mut BarStruct` + //~| expected box, found &-ptr } fn main() {} diff --git a/src/test/compile-fail/issue-7092.rs b/src/test/compile-fail/issue-7092.rs index 4acbcb165ff08..638f45cd35776 100644 --- a/src/test/compile-fail/issue-7092.rs +++ b/src/test/compile-fail/issue-7092.rs @@ -15,11 +15,10 @@ fn foo(x: Whatever) { match x { Some(field) => //~^ ERROR mismatched types -//~| expected `Whatever` -//~| found `std::option::Option<_>` -//~| expected enum `Whatever` -//~| found enum `std::option::Option` - field.access(), +//~| expected type `Whatever` +//~| found type `std::option::Option<_>` +//~| expected enum `Whatever`, found enum `std::option::Option` + field.access(), } } diff --git a/src/test/compile-fail/issue-7867.rs b/src/test/compile-fail/issue-7867.rs index 95513860b084f..e0de860b0eac3 100644 --- a/src/test/compile-fail/issue-7867.rs +++ b/src/test/compile-fail/issue-7867.rs @@ -16,25 +16,22 @@ fn main() { match (true, false) { A::B => (), //~^ ERROR mismatched types - //~| expected `(bool, bool)` - //~| found `A` - //~| expected tuple - //~| found enum `A` + //~| expected type `(bool, bool)` + //~| found type `A` + //~| expected tuple, found enum `A` _ => () } match &Some(42) { Some(x) => (), //~^ ERROR mismatched types - //~| expected `&std::option::Option<_>` - //~| found `std::option::Option<_>` - //~| expected &-ptr - //~| found enum `std::option::Option` + //~| expected type `&std::option::Option<_>` + //~| found type `std::option::Option<_>` + //~| expected &-ptr, found enum `std::option::Option` None => () //~^ ERROR mismatched types - //~| expected `&std::option::Option<_>` - //~| found `std::option::Option<_>` - //~| expected &-ptr - //~| found enum `std::option::Option` + //~| expected type `&std::option::Option<_>` + //~| found type `std::option::Option<_>` + //~| expected &-ptr, found enum `std::option::Option` } } diff --git a/src/test/compile-fail/issue-9575.rs b/src/test/compile-fail/issue-9575.rs index 94dd787f08635..9295eeb1779b0 100644 --- a/src/test/compile-fail/issue-9575.rs +++ b/src/test/compile-fail/issue-9575.rs @@ -12,6 +12,6 @@ #[start] fn start(argc: isize, argv: *const *const u8, crate_map: *const u8) -> isize { - //~^ ERROR incorrect number of function parameters + //~^ start function has wrong type 0 } diff --git a/src/test/compile-fail/main-wrong-type-2.rs b/src/test/compile-fail/main-wrong-type-2.rs index 09d5765a80f3f..7434a6c960b2d 100644 --- a/src/test/compile-fail/main-wrong-type-2.rs +++ b/src/test/compile-fail/main-wrong-type-2.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() -> char { -//~^ ERROR: main function expects type +//~^ ERROR: main function has wrong type } diff --git a/src/test/compile-fail/main-wrong-type.rs b/src/test/compile-fail/main-wrong-type.rs index d9c617a71720e..431b855d51773 100644 --- a/src/test/compile-fail/main-wrong-type.rs +++ b/src/test/compile-fail/main-wrong-type.rs @@ -14,5 +14,5 @@ struct S { } fn main(foo: S) { -//~^ ERROR: main function expects type +//~^ ERROR: main function has wrong type } diff --git a/src/test/compile-fail/match-range-fail.rs b/src/test/compile-fail/match-range-fail.rs index 05b870b8f41cc..526aa83dec7fd 100644 --- a/src/test/compile-fail/match-range-fail.rs +++ b/src/test/compile-fail/match-range-fail.rs @@ -28,6 +28,5 @@ fn main() { _ => { } }; //~^^^ ERROR mismatched types in range - //~| expected char - //~| found integral variable + //~| expected char, found integral variable } diff --git a/src/test/compile-fail/match-struct.rs b/src/test/compile-fail/match-struct.rs index 5bda37896879b..0dbdda1f9ba1e 100644 --- a/src/test/compile-fail/match-struct.rs +++ b/src/test/compile-fail/match-struct.rs @@ -16,10 +16,9 @@ fn main() { match (S { a: 1 }) { E::C(_) => (), //~^ ERROR mismatched types - //~| expected `S` - //~| found `E` - //~| expected struct `S` - //~| found enum `E` + //~| expected type `S` + //~| found type `E` + //~| expected struct `S`, found enum `E` _ => () } } diff --git a/src/test/compile-fail/match-vec-mismatch-2.rs b/src/test/compile-fail/match-vec-mismatch-2.rs index 0bbba8861217d..2831499c73d87 100644 --- a/src/test/compile-fail/match-vec-mismatch-2.rs +++ b/src/test/compile-fail/match-vec-mismatch-2.rs @@ -14,9 +14,8 @@ fn main() { match () { [()] => { } //~^ ERROR mismatched types - //~| expected `()` - //~| found `&[_]` - //~| expected () - //~| found &-ptr + //~| expected type `()` + //~| found type `&[_]` + //~| expected (), found &-ptr } } diff --git a/src/test/compile-fail/method-self-arg-1.rs b/src/test/compile-fail/method-self-arg-1.rs index 57a96bb9a26ea..ffa5287d4b2c3 100644 --- a/src/test/compile-fail/method-self-arg-1.rs +++ b/src/test/compile-fail/method-self-arg-1.rs @@ -19,13 +19,11 @@ impl Foo { fn main() { let x = Foo; Foo::bar(x); //~ ERROR mismatched types - //~| expected `&Foo` - //~| found `Foo` - //~| expected &-ptr - //~| found struct `Foo` + //~| expected type `&Foo` + //~| found type `Foo` + //~| expected &-ptr, found struct `Foo` Foo::bar(&42); //~ ERROR mismatched types - //~| expected `&Foo` - //~| found `&_` - //~| expected struct `Foo` - //~| found integral variable + //~| expected type `&Foo` + //~| found type `&_` + //~| expected struct `Foo`, found integral variable } diff --git a/src/test/compile-fail/moves-based-on-type-distribute-copy-over-paren.rs b/src/test/compile-fail/moves-based-on-type-distribute-copy-over-paren.rs index f30360af46eb4..02c09aa7d69a2 100644 --- a/src/test/compile-fail/moves-based-on-type-distribute-copy-over-paren.rs +++ b/src/test/compile-fail/moves-based-on-type-distribute-copy-over-paren.rs @@ -16,13 +16,17 @@ fn touch(_a: &A) {} fn f00() { let x = "hi".to_string(); - let _y = Foo { f:x }; //~ NOTE `x` moved here + let _y = Foo { f:x }; + //~^ value moved here touch(&x); //~ ERROR use of moved value: `x` + //~^ value used here after move + //~| move occurs because `x` has type `std::string::String` } fn f05() { let x = "hi".to_string(); - let _y = Foo { f:(((x))) }; //~ NOTE `x` moved here + let _y = Foo { f:(((x))) }; + //~^ value moved here touch(&x); //~ ERROR use of moved value: `x` } diff --git a/src/test/compile-fail/moves-based-on-type-match-bindings.rs b/src/test/compile-fail/moves-based-on-type-match-bindings.rs index 7d209467caf2a..bcbb8dbfad121 100644 --- a/src/test/compile-fail/moves-based-on-type-match-bindings.rs +++ b/src/test/compile-fail/moves-based-on-type-match-bindings.rs @@ -24,6 +24,8 @@ fn f10() { }; touch(&x); //~ ERROR use of partially moved value: `x` + //~^ value used here after move + //~| move occurs because `x.f` has type `std::string::String` } fn main() {} diff --git a/src/test/compile-fail/mut-pattern-mismatched.rs b/src/test/compile-fail/mut-pattern-mismatched.rs index 9eb24c81960ca..63e7dbd30def2 100644 --- a/src/test/compile-fail/mut-pattern-mismatched.rs +++ b/src/test/compile-fail/mut-pattern-mismatched.rs @@ -14,8 +14,8 @@ fn main() { // (separate lines to ensure the spans are accurate) let &_ //~ ERROR mismatched types - //~| expected `&mut _` - //~| found `&_` + //~| expected type `&mut _` + //~| found type `&_` //~| values differ in mutability = foo; let &mut _ = foo; @@ -23,8 +23,8 @@ fn main() { let bar = &1; let &_ = bar; let &mut _ //~ ERROR mismatched types - //~| expected `&_` - //~| found `&mut _` + //~| expected type `&_` + //~| found type `&mut _` //~| values differ in mutability = bar; } diff --git a/src/test/compile-fail/noexporttypeexe.rs b/src/test/compile-fail/noexporttypeexe.rs index 687e1e49ee844..c950ef5b68002 100644 --- a/src/test/compile-fail/noexporttypeexe.rs +++ b/src/test/compile-fail/noexporttypeexe.rs @@ -19,8 +19,7 @@ fn main() { // not convertible to a path. let x: isize = noexporttypelib::foo(); //~^ ERROR mismatched types - //~| expected `isize` - //~| found `std::option::Option` - //~| expected isize - //~| found enum `std::option::Option` + //~| expected type `isize` + //~| found type `std::option::Option` + //~| expected isize, found enum `std::option::Option` } diff --git a/src/test/compile-fail/occurs-check-2.rs b/src/test/compile-fail/occurs-check-2.rs index fd2903a85ddb0..5cb60079fa4b8 100644 --- a/src/test/compile-fail/occurs-check-2.rs +++ b/src/test/compile-fail/occurs-check-2.rs @@ -16,7 +16,7 @@ fn main() { g = f; f = box g; //~^ ERROR mismatched types - //~| expected `_` - //~| found `Box<_>` + //~| expected type `_` + //~| found type `Box<_>` //~| cyclic type of infinite size } diff --git a/src/test/compile-fail/occurs-check.rs b/src/test/compile-fail/occurs-check.rs index 036fcc1b9d779..499124cb0573b 100644 --- a/src/test/compile-fail/occurs-check.rs +++ b/src/test/compile-fail/occurs-check.rs @@ -14,7 +14,7 @@ fn main() { let f; f = box f; //~^ ERROR mismatched types - //~| expected `_` - //~| found `Box<_>` + //~| expected type `_` + //~| found type `Box<_>` //~| cyclic type of infinite size } diff --git a/src/test/compile-fail/pattern-error-continue.rs b/src/test/compile-fail/pattern-error-continue.rs index 9b67595800320..d9f3bb3c40f8d 100644 --- a/src/test/compile-fail/pattern-error-continue.rs +++ b/src/test/compile-fail/pattern-error-continue.rs @@ -31,17 +31,15 @@ fn main() { match 'c' { S { .. } => (), //~^ ERROR mismatched types - //~| expected `char` - //~| found `S` - //~| expected char - //~| found struct `S` + //~| expected type `char` + //~| found type `S` + //~| expected char, found struct `S` _ => () } f(true); //~^ ERROR mismatched types - //~| expected `char` - //~| found `bool` + //~| expected char, found bool match () { E::V => {} //~ ERROR failed to resolve. Use of undeclared type or module `E` diff --git a/src/test/compile-fail/pptypedef.rs b/src/test/compile-fail/pptypedef.rs index 1a1c87ff47d46..7ece52e753786 100644 --- a/src/test/compile-fail/pptypedef.rs +++ b/src/test/compile-fail/pptypedef.rs @@ -13,11 +13,9 @@ fn let_in(x: T, f: F) where F: FnOnce(T) {} fn main() { let_in(3u32, |i| { assert!(i == 3i32); }); //~^ ERROR mismatched types - //~| expected `u32` - //~| found `i32` + //~| expected u32, found i32 let_in(3i32, |i| { assert!(i == 3u32); }); //~^ ERROR mismatched types - //~| expected `i32` - //~| found `u32` + //~| expected i32, found u32 } diff --git a/src/test/compile-fail/ptr-coercion.rs b/src/test/compile-fail/ptr-coercion.rs index 18e210076cb55..ff627e69d4c58 100644 --- a/src/test/compile-fail/ptr-coercion.rs +++ b/src/test/compile-fail/ptr-coercion.rs @@ -15,19 +15,19 @@ pub fn main() { // *const -> *mut let x: *const isize = &42; let x: *mut isize = x; //~ ERROR mismatched types - //~| expected `*mut isize` - //~| found `*const isize` + //~| expected type `*mut isize` + //~| found type `*const isize` //~| values differ in mutability // & -> *mut let x: *mut isize = &42; //~ ERROR mismatched types - //~| expected `*mut isize` - //~| found `&isize` + //~| expected type `*mut isize` + //~| found type `&isize` //~| values differ in mutability let x: *const isize = &42; let x: *mut isize = x; //~ ERROR mismatched types - //~| expected `*mut isize` - //~| found `*const isize` + //~| expected type `*mut isize` + //~| found type `*const isize` //~| values differ in mutability } diff --git a/src/test/compile-fail/ref-suggestion.rs b/src/test/compile-fail/ref-suggestion.rs index 815f752663223..0a0867195d976 100644 --- a/src/test/compile-fail/ref-suggestion.rs +++ b/src/test/compile-fail/ref-suggestion.rs @@ -11,22 +11,16 @@ fn main() { let x = vec![1]; let y = x; - //~^ HELP use a `ref` binding as shown - //~| SUGGESTION let ref y = x; x; //~ ERROR use of moved value let x = vec![1]; let mut y = x; - //~^ HELP use a `ref` binding as shown - //~| SUGGESTION let ref mut y = x; x; //~ ERROR use of moved value let x = (Some(vec![1]), ()); match x { (Some(y), ()) => {}, - //~^ HELP use a `ref` binding as shown - //~| SUGGESTION (Some(ref y), ()) => {}, _ => {}, } x; //~ ERROR use of partially moved value diff --git a/src/test/compile-fail/regions-bounds.rs b/src/test/compile-fail/regions-bounds.rs index 7f2889a327be0..64dbf27b78e48 100644 --- a/src/test/compile-fail/regions-bounds.rs +++ b/src/test/compile-fail/regions-bounds.rs @@ -17,15 +17,15 @@ struct a_class<'a> { x:&'a isize } fn a_fn1<'a,'b>(e: an_enum<'a>) -> an_enum<'b> { return e; //~ ERROR mismatched types - //~| expected `an_enum<'b>` - //~| found `an_enum<'a>` + //~| expected type `an_enum<'b>` + //~| found type `an_enum<'a>` //~| lifetime mismatch } fn a_fn3<'a,'b>(e: a_class<'a>) -> a_class<'b> { return e; //~ ERROR mismatched types - //~| expected `a_class<'b>` - //~| found `a_class<'a>` + //~| expected type `a_class<'b>` + //~| found type `a_class<'a>` //~| lifetime mismatch } diff --git a/src/test/compile-fail/regions-early-bound-error-method.rs b/src/test/compile-fail/regions-early-bound-error-method.rs index 8cc35272282c4..f6a0c86de6626 100644 --- a/src/test/compile-fail/regions-early-bound-error-method.rs +++ b/src/test/compile-fail/regions-early-bound-error-method.rs @@ -29,8 +29,8 @@ impl<'a> Box<'a> { fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize { g2.get() //~^ ERROR mismatched types - //~| expected `&'a isize` - //~| found `&'b isize` + //~| expected type `&'a isize` + //~| found type `&'b isize` //~| lifetime mismatch } diff --git a/src/test/compile-fail/regions-fn-subtyping-return-static.rs b/src/test/compile-fail/regions-fn-subtyping-return-static.rs index ebf7ca289f889..c0116b21166e0 100644 --- a/src/test/compile-fail/regions-fn-subtyping-return-static.rs +++ b/src/test/compile-fail/regions-fn-subtyping-return-static.rs @@ -55,10 +55,9 @@ fn supply_G() { want_G(bar); want_G(baz); //~^ ERROR mismatched types - //~| expected `fn(&'cx S) -> &'static S` - //~| found `fn(&S) -> &S {baz}` - //~| expected concrete lifetime - //~| found bound lifetime parameter 'cx + //~| expected type `fn(&'cx S) -> &'static S` + //~| found type `fn(&S) -> &S {baz}` + //~| expected concrete lifetime, found bound lifetime parameter 'cx } pub fn main() { diff --git a/src/test/compile-fail/regions-infer-not-param.rs b/src/test/compile-fail/regions-infer-not-param.rs index 83b9d4633dcf3..131b7170951f6 100644 --- a/src/test/compile-fail/regions-infer-not-param.rs +++ b/src/test/compile-fail/regions-infer-not-param.rs @@ -27,10 +27,10 @@ fn take_direct<'a,'b>(p: direct<'a>) -> direct<'b> { p } //~ ERROR mismatched ty fn take_indirect1(p: indirect1) -> indirect1 { p } fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types -//~| expected `indirect2<'b>` -//~| found `indirect2<'a>` +//~| expected type `indirect2<'b>` +//~| found type `indirect2<'a>` //~| ERROR mismatched types -//~| expected `indirect2<'b>` -//~| found `indirect2<'a>` +//~| expected type `indirect2<'b>` +//~| found type `indirect2<'a>` fn main() {} diff --git a/src/test/compile-fail/regions-infer-paramd-indirect.rs b/src/test/compile-fail/regions-infer-paramd-indirect.rs index 1d32e8fe7b250..fad115c2aedf8 100644 --- a/src/test/compile-fail/regions-infer-paramd-indirect.rs +++ b/src/test/compile-fail/regions-infer-paramd-indirect.rs @@ -32,8 +32,8 @@ impl<'a> set_f<'a> for c<'a> { fn set_f_bad(&mut self, b: Box) { self.f = b; //~^ ERROR mismatched types - //~| expected `Box>` - //~| found `Box>` + //~| expected type `Box>` + //~| found type `Box>` //~| lifetime mismatch } } diff --git a/src/test/compile-fail/reject-specialized-drops-8142.rs b/src/test/compile-fail/reject-specialized-drops-8142.rs index adc8702240378..1ea956bbd5489 100644 --- a/src/test/compile-fail/reject-specialized-drops-8142.rs +++ b/src/test/compile-fail/reject-specialized-drops-8142.rs @@ -38,8 +38,8 @@ impl<'ml> Drop for M<'ml> { fn drop(&mut self) { } } // AC impl Drop for N<'static> { fn drop(&mut self) { } } // REJECT //~^ ERROR mismatched types -//~| expected `N<'n>` -//~| found `N<'static>` +//~| expected type `N<'n>` +//~| found type `N<'static>` impl Drop for O { fn drop(&mut self) { } } // ACCEPT diff --git a/src/test/compile-fail/repeat_count.rs b/src/test/compile-fail/repeat_count.rs index 10b722946a8a8..ab5af64d95c13 100644 --- a/src/test/compile-fail/repeat_count.rs +++ b/src/test/compile-fail/repeat_count.rs @@ -16,52 +16,45 @@ fn main() { //~^ ERROR expected constant integer for repeat count, found variable [E0307] let b = [0; ()]; //~^ ERROR mismatched types - //~| expected `usize` - //~| found `()` - //~| expected usize - //~| found ()) [E0308] + //~| expected type `usize` + //~| found type `()` + //~| expected usize, found () //~| ERROR expected positive integer for repeat count, found tuple [E0306] let c = [0; true]; //~^ ERROR mismatched types - //~| expected `usize` - //~| found `bool` + //~| expected usize, found bool //~| ERROR expected positive integer for repeat count, found boolean [E0306] let d = [0; 0.5]; //~^ ERROR mismatched types - //~| expected `usize` - //~| found `_` - //~| expected usize - //~| found floating-point variable) [E0308] + //~| expected type `usize` + //~| found type `_` + //~| expected usize, found floating-point variable //~| ERROR expected positive integer for repeat count, found float [E0306] let e = [0; "foo"]; //~^ ERROR mismatched types - //~| expected `usize` - //~| found `&'static str` - //~| expected usize - //~| found &-ptr) [E0308] + //~| expected type `usize` + //~| found type `&'static str` + //~| expected usize, found &-ptr //~| ERROR expected positive integer for repeat count, found string literal [E0306] let f = [0; -4_isize]; //~^ ERROR mismatched types //~| expected `usize` - //~| found `isize` [E0308] + //~| found `isize` //~| ERROR mismatched types: - //~| expected `usize`, - //~| found `isize` [E0307] + //~| expected usize, found isize let f = [0_usize; -1_isize]; //~^ ERROR mismatched types //~| expected `usize` - //~| found `isize` [E0308] + //~| found `isize` //~| ERROR mismatched types - //~| expected `usize` - //~| found `isize` [E0307] + //~| expected usize, found isize struct G { g: (), } let g = [0; G { g: () }]; //~^ ERROR mismatched types - //~| expected `usize` - //~| found `main::G` - //~| expected usize - //~| found struct `main::G`) [E0308] + //~| expected type `usize` + //~| found type `main::G` + //~| expected usize, found struct `main::G` //~| ERROR expected positive integer for repeat count, found struct [E0306] } diff --git a/src/test/compile-fail/shift-various-bad-types.rs b/src/test/compile-fail/shift-various-bad-types.rs index 560af9193b35e..2d06161111ef1 100644 --- a/src/test/compile-fail/shift-various-bad-types.rs +++ b/src/test/compile-fail/shift-various-bad-types.rs @@ -34,8 +34,7 @@ fn foo(p: &Panolpy) { // Type of the result follows the LHS, not the RHS: let _: i32 = 22_i64 >> 1_i32; //~^ ERROR mismatched types - //~| expected `i32` - //~| found `i64` + //~| expected i32, found i64 } fn main() { diff --git a/src/test/compile-fail/slice-mut.rs b/src/test/compile-fail/slice-mut.rs index e6acc32545178..874cca8cb3fd0 100644 --- a/src/test/compile-fail/slice-mut.rs +++ b/src/test/compile-fail/slice-mut.rs @@ -16,7 +16,7 @@ fn main() { let y: &mut[_] = &x[2..4]; //~^ ERROR mismatched types - //~| expected `&mut [_]` - //~| found `&[isize]` + //~| expected type `&mut [_]` + //~| found type `&[isize]` //~| values differ in mutability } diff --git a/src/test/compile-fail/slightly-nice-generic-literal-messages.rs b/src/test/compile-fail/slightly-nice-generic-literal-messages.rs index 3c1c3796a246f..3140bb6e5731d 100644 --- a/src/test/compile-fail/slightly-nice-generic-literal-messages.rs +++ b/src/test/compile-fail/slightly-nice-generic-literal-messages.rs @@ -16,10 +16,9 @@ fn main() { match Foo(1.1, marker::PhantomData) { 1 => {} //~^ ERROR mismatched types - //~| expected `Foo<_, _>` - //~| found `_` - //~| expected struct `Foo` - //~| found integral variable + //~| expected type `Foo<_, _>` + //~| found type `_` + //~| expected struct `Foo`, found integral variable } } diff --git a/src/test/compile-fail/struct-base-wrong-type-2.rs b/src/test/compile-fail/struct-base-wrong-type-2.rs index 83e73b6bc3ef4..1250d0dabcd9a 100644 --- a/src/test/compile-fail/struct-base-wrong-type-2.rs +++ b/src/test/compile-fail/struct-base-wrong-type-2.rs @@ -19,13 +19,11 @@ struct Bar { x: isize } fn main() { let b = Bar { x: 5 }; let f = Foo { a: 2, ..b }; //~ ERROR mismatched types - //~| expected `Foo` - //~| found `Bar` - //~| expected struct `Foo` - //~| found struct `Bar` + //~| expected type `Foo` + //~| found type `Bar` + //~| expected struct `Foo`, found struct `Bar` let f__isize = Foo { a: 2, ..4 }; //~ ERROR mismatched types - //~| expected `Foo` - //~| found `_` - //~| expected struct `Foo` - //~| found integral variable + //~| expected type `Foo` + //~| found type `_` + //~| expected struct `Foo`, found integral variable } diff --git a/src/test/compile-fail/struct-base-wrong-type.rs b/src/test/compile-fail/struct-base-wrong-type.rs index c98131560d486..4503e465840fe 100644 --- a/src/test/compile-fail/struct-base-wrong-type.rs +++ b/src/test/compile-fail/struct-base-wrong-type.rs @@ -18,15 +18,13 @@ struct Bar { x: isize } static bar: Bar = Bar { x: 5 }; static foo: Foo = Foo { a: 2, ..bar }; //~ ERROR mismatched types - //~| expected `Foo` - //~| found `Bar` - //~| expected struct `Foo` - //~| found struct `Bar` + //~| expected type `Foo` + //~| found type `Bar` + //~| expected struct `Foo`, found struct `Bar` static foo_i: Foo = Foo { a: 2, ..4 }; //~ ERROR mismatched types - //~| expected `Foo` - //~| found `_` - //~| expected struct `Foo` - //~| found integral variable + //~| expected type `Foo` + //~| found type `_` + //~| expected struct `Foo`, found integral variable fn main() { let b = Bar { x: 5 }; diff --git a/src/test/compile-fail/structure-constructor-type-mismatch.rs b/src/test/compile-fail/structure-constructor-type-mismatch.rs index 7a6b8ff662240..87fc5ba93aeb3 100644 --- a/src/test/compile-fail/structure-constructor-type-mismatch.rs +++ b/src/test/compile-fail/structure-constructor-type-mismatch.rs @@ -26,38 +26,32 @@ fn main() { let pt = PointF { x: 1, //~^ ERROR mismatched types - //~| expected f32 - //~| found integral variable + //~| expected f32, found integral variable y: 2, //~^ ERROR mismatched types - //~| expected f32 - //~| found integral variable + //~| expected f32, found integral variable }; let pt2 = Point:: { x: 3, //~^ ERROR mismatched types - //~| expected f32 - //~| found integral variable + //~| expected f32, found integral variable y: 4, //~^ ERROR mismatched types - //~| expected f32 - //~| found integral variable + //~| expected f32, found integral variable }; let pair = PairF { x: 5, //~^ ERROR mismatched types - //~| expected f32 - //~| found integral variable + //~| expected f32, found integral variable y: 6, }; let pair2 = PairF:: { x: 7, //~^ ERROR mismatched types - //~| expected f32 - //~| found integral variable + //~| expected f32, found integral variable y: 8, }; diff --git a/src/test/compile-fail/substs-ppaux.rs b/src/test/compile-fail/substs-ppaux.rs index 8dd9994b234ba..c857790e342d0 100644 --- a/src/test/compile-fail/substs-ppaux.rs +++ b/src/test/compile-fail/substs-ppaux.rs @@ -24,36 +24,36 @@ fn main() {} fn foo<'z>() where &'z (): Sized { let x: () = >::bar::<'static, char>; //[verbose]~^ ERROR mismatched types - //[verbose]~| expected `()` - //[verbose]~| found `fn() {>::bar::}` + //[verbose]~| expected type `()` + //[verbose]~| found type `fn() {>::bar::}` //[normal]~^^^^ ERROR mismatched types - //[normal]~| expected `()` - //[normal]~| found `fn() {>::bar::<'static, char>}` + //[normal]~| expected type `()` + //[normal]~| found type `fn() {>::bar::<'static, char>}` let x: () = >::bar::<'static, char>; //[verbose]~^ ERROR mismatched types - //[verbose]~| expected `()` - //[verbose]~| found `fn() {>::bar::}` + //[verbose]~| expected type `()` + //[verbose]~| found type `fn() {>::bar::}` //[normal]~^^^^ ERROR mismatched types - //[normal]~| expected `()` - //[normal]~| found `fn() {>::bar::<'static, char>}` + //[normal]~| expected type `()` + //[normal]~| found type `fn() {>::bar::<'static, char>}` let x: () = >::baz; //[verbose]~^ ERROR mismatched types - //[verbose]~| expected `()` - //[verbose]~| found `fn() {>::baz}` + //[verbose]~| expected type `()` + //[verbose]~| found type `fn() {>::baz}` //[normal]~^^^^ ERROR mismatched types - //[normal]~| expected `()` - //[normal]~| found `fn() {>::baz}` + //[normal]~| expected type `()` + //[normal]~| found type `fn() {>::baz}` let x: () = foo::<'static>; //[verbose]~^ ERROR mismatched types - //[verbose]~| expected `()` - //[verbose]~| found `fn() {foo::}` + //[verbose]~| expected type `()` + //[verbose]~| found type `fn() {foo::}` //[normal]~^^^^ ERROR mismatched types - //[normal]~| expected `()` - //[normal]~| found `fn() {foo::<'static>}` + //[normal]~| expected type `()` + //[normal]~| found type `fn() {foo::<'static>}` >::bar; //[verbose]~^ ERROR `str: std::marker::Sized` is not satisfied diff --git a/src/test/compile-fail/suppressed-error.rs b/src/test/compile-fail/suppressed-error.rs index 44de5d8cfe353..9a4a52ced2008 100644 --- a/src/test/compile-fail/suppressed-error.rs +++ b/src/test/compile-fail/suppressed-error.rs @@ -11,9 +11,8 @@ fn main() { let (x, y) = (); //~^ ERROR mismatched types -//~| expected `()` -//~| found `(_, _)` -//~| expected () -//~| found tuple +//~| expected type `()` +//~| found type `(_, _)` +//~| expected (), found tuple return x; } diff --git a/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs b/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs index 725234dfeab56..8f420f1ce4b0d 100644 --- a/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs +++ b/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs @@ -21,8 +21,7 @@ fn main() { let y; let x : char = last(y); //~^ ERROR mismatched types - //~| expected `char` - //~| found `std::option::Option<_>` - //~| expected char - //~| found enum `std::option::Option` + //~| expected type `char` + //~| found type `std::option::Option<_>` + //~| expected char, found enum `std::option::Option` } diff --git a/src/test/compile-fail/terr-in-field.rs b/src/test/compile-fail/terr-in-field.rs index 60db35b879f57..4a21e1339811e 100644 --- a/src/test/compile-fail/terr-in-field.rs +++ b/src/test/compile-fail/terr-in-field.rs @@ -21,10 +21,9 @@ struct bar { fn want_foo(f: foo) {} fn have_bar(b: bar) { want_foo(b); //~ ERROR mismatched types - //~| expected `foo` - //~| found `bar` - //~| expected struct `foo` - //~| found struct `bar` + //~| expected type `foo` + //~| found type `bar` + //~| expected struct `foo`, found struct `bar` } fn main() {} diff --git a/src/test/compile-fail/terr-sorts.rs b/src/test/compile-fail/terr-sorts.rs index 231d2366b48a8..592d7b3929bfc 100644 --- a/src/test/compile-fail/terr-sorts.rs +++ b/src/test/compile-fail/terr-sorts.rs @@ -19,10 +19,9 @@ type bar = Box; fn want_foo(f: foo) {} fn have_bar(b: bar) { want_foo(b); //~ ERROR mismatched types - //~| expected `foo` - //~| found `Box` - //~| expected struct `foo` - //~| found box + //~| expected type `foo` + //~| found type `Box` + //~| expected struct `foo`, found box } fn main() {} diff --git a/src/test/compile-fail/token-error-correct-3.rs b/src/test/compile-fail/token-error-correct-3.rs index f42c8d09a9c09..24627e9420874 100644 --- a/src/test/compile-fail/token-error-correct-3.rs +++ b/src/test/compile-fail/token-error-correct-3.rs @@ -22,6 +22,9 @@ pub mod raw { callback(path.as_ref(); //~ NOTE: unclosed delimiter //~^ ERROR: expected one of fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types + //~^ expected (), found enum `std::result::Result` + //~| expected type `()` + //~| found type `std::result::Result` } else { //~ ERROR: incorrect close delimiter: `}` //~^ ERROR: expected one of Ok(false); diff --git a/src/test/compile-fail/trait-bounds-cant-coerce.rs b/src/test/compile-fail/trait-bounds-cant-coerce.rs index 836f08d0e78bb..1fff812af5b8d 100644 --- a/src/test/compile-fail/trait-bounds-cant-coerce.rs +++ b/src/test/compile-fail/trait-bounds-cant-coerce.rs @@ -22,10 +22,9 @@ fn c(x: Box) { fn d(x: Box) { a(x); //~ ERROR mismatched types - //~| expected `Box` - //~| found `Box` - //~| expected bounds `Send` - //~| found no bounds + //~| expected type `Box` + //~| found type `Box` + //~| expected bounds `Send`, found no bounds } fn main() { } diff --git a/src/test/compile-fail/tuple-arity-mismatch.rs b/src/test/compile-fail/tuple-arity-mismatch.rs index 8ad9ca50e3042..e62255a4e77d4 100644 --- a/src/test/compile-fail/tuple-arity-mismatch.rs +++ b/src/test/compile-fail/tuple-arity-mismatch.rs @@ -15,15 +15,13 @@ fn first((value, _): (isize, f64)) -> isize { value } fn main() { let y = first ((1,2.0,3)); //~^ ERROR mismatched types - //~| expected `(isize, f64)` - //~| found `(isize, f64, _)` - //~| expected a tuple with 2 elements - //~| found one with 3 elements + //~| expected type `(isize, f64)` + //~| found type `(isize, f64, _)` + //~| expected a tuple with 2 elements, found one with 3 elements let y = first ((1,)); //~^ ERROR mismatched types - //~| expected `(isize, f64)` - //~| found `(isize,)` - //~| expected a tuple with 2 elements - //~| found one with 1 elements + //~| expected type `(isize, f64)` + //~| found type `(isize,)` + //~| expected a tuple with 2 elements, found one with 1 elements } diff --git a/src/test/compile-fail/tutorial-suffix-inference-test.rs b/src/test/compile-fail/tutorial-suffix-inference-test.rs index 99d6437c02ed4..dadf7eb91d8f4 100644 --- a/src/test/compile-fail/tutorial-suffix-inference-test.rs +++ b/src/test/compile-fail/tutorial-suffix-inference-test.rs @@ -18,12 +18,10 @@ fn main() { identity_u8(x); // after this, `x` is assumed to have type `u8` identity_u16(x); //~^ ERROR mismatched types - //~| expected `u16` - //~| found `u8` + //~| expected u16, found u8 identity_u16(y); //~^ ERROR mismatched types - //~| expected `u16` - //~| found `i32` + //~| expected u16, found i32 let a = 3; @@ -32,6 +30,5 @@ fn main() { identity_i(a); // ok identity_u16(a); //~^ ERROR mismatched types - //~| expected `u16` - //~| found `isize` + //~| expected u16, found isize } diff --git a/src/test/compile-fail/type-mismatch-multiple.rs b/src/test/compile-fail/type-mismatch-multiple.rs index dd8f54cdabb8f..0f174d99fefcb 100644 --- a/src/test/compile-fail/type-mismatch-multiple.rs +++ b/src/test/compile-fail/type-mismatch-multiple.rs @@ -12,11 +12,9 @@ fn main() { let a: bool = 1; let b: i32 = true; } //~^ ERROR mismatched types -//~| expected `bool` -//~| found `_` -//~| expected bool -//~| found integral variable +//~| expected type `bool` +//~| found type `_` +//~| expected bool, found integral variable //~| ERROR mismatched types -//~| expected `i32` -//~| found `bool` +//~| expected i32, found bool diff --git a/src/test/compile-fail/type-mismatch-same-crate-name.rs b/src/test/compile-fail/type-mismatch-same-crate-name.rs index e81ae5d743939..e74acaa71b0f3 100644 --- a/src/test/compile-fail/type-mismatch-same-crate-name.rs +++ b/src/test/compile-fail/type-mismatch-same-crate-name.rs @@ -23,9 +23,17 @@ fn main() { let bar2 = {extern crate crate_a2 as a; a::bar()}; { extern crate crate_a1 as a; - a::try_foo(foo2); //~ ERROR mismatched types - //~^ NOTE Perhaps two different versions of crate `crate_a1` - a::try_bar(bar2); //~ ERROR mismatched types - //~^ NOTE Perhaps two different versions of crate `crate_a1` + a::try_foo(foo2); + //~^ ERROR mismatched types + //~| Perhaps two different versions of crate `crate_a1` + //~| expected struct `main::a::Foo` + //~| expected type `main::a::Foo` + //~| found type `main::a::Foo` + a::try_bar(bar2); + //~^ ERROR mismatched types + //~| Perhaps two different versions of crate `crate_a1` + //~| expected trait `main::a::Bar` + //~| expected type `Box` + //~| found type `Box` } } diff --git a/src/test/compile-fail/type-parameter-names.rs b/src/test/compile-fail/type-parameter-names.rs index 408bf72e97c87..11a2fc2665ca4 100644 --- a/src/test/compile-fail/type-parameter-names.rs +++ b/src/test/compile-fail/type-parameter-names.rs @@ -14,10 +14,9 @@ fn foo(x: Foo) -> Bar { x //~^ ERROR mismatched types -//~| expected `Bar` -//~| found `Foo` -//~| expected type parameter -//~| found a different type parameter +//~| expected type `Bar` +//~| found type `Foo` +//~| expected type parameter, found a different type parameter } fn main() {} diff --git a/src/test/compile-fail/type-params-in-different-spaces-1.rs b/src/test/compile-fail/type-params-in-different-spaces-1.rs index 155b835bbc6e0..26eac6adde221 100644 --- a/src/test/compile-fail/type-params-in-different-spaces-1.rs +++ b/src/test/compile-fail/type-params-in-different-spaces-1.rs @@ -13,10 +13,9 @@ use std::ops::Add; trait BrokenAdd: Copy + Add { fn broken_add(&self, rhs: T) -> Self { *self + rhs //~ ERROR mismatched types - //~| expected `Self` - //~| found `T` - //~| expected Self - //~| found type parameter + //~| expected type `Self` + //~| found type `T` + //~| expected Self, found type parameter } } diff --git a/src/test/compile-fail/typeck_type_placeholder_mismatch.rs b/src/test/compile-fail/typeck_type_placeholder_mismatch.rs index 1daea8f915b3f..91e3c38322e47 100644 --- a/src/test/compile-fail/typeck_type_placeholder_mismatch.rs +++ b/src/test/compile-fail/typeck_type_placeholder_mismatch.rs @@ -22,18 +22,16 @@ pub fn main() { fn test1() { let x: Foo<_> = Bar::(PhantomData); //~^ ERROR mismatched types - //~| expected `Foo<_>` - //~| found `Bar` - //~| expected struct `Foo` - //~| found struct `Bar` + //~| expected type `Foo<_>` + //~| found type `Bar` + //~| expected struct `Foo`, found struct `Bar` let y: Foo = x; } fn test2() { let x: Foo<_> = Bar::(PhantomData); //~^ ERROR mismatched types - //~| expected `Foo<_>` - //~| found `Bar` - //~| expected struct `Foo` - //~| found struct `Bar` + //~| expected type `Foo<_>` + //~| found type `Bar` + //~| expected struct `Foo`, found struct `Bar` } diff --git a/src/test/compile-fail/ufcs-explicit-self-bad.rs b/src/test/compile-fail/ufcs-explicit-self-bad.rs index e54a7623cb0c3..f14a3505cdeb4 100644 --- a/src/test/compile-fail/ufcs-explicit-self-bad.rs +++ b/src/test/compile-fail/ufcs-explicit-self-bad.rs @@ -45,12 +45,12 @@ impl<'a, T> SomeTrait for &'a Bar { //~^ ERROR mismatched types fn dummy3(self: &&Bar) {} //~^ ERROR mismatched types - //~| expected `&&'a Bar` - //~| found `&&Bar` + //~| expected type `&&'a Bar` + //~| found type `&&Bar` //~| lifetime mismatch //~| ERROR mismatched types - //~| expected `&&'a Bar` - //~| found `&&Bar` + //~| expected type `&&'a Bar` + //~| found type `&&Bar` //~| lifetime mismatch } diff --git a/src/test/compile-fail/variadic-ffi-3.rs b/src/test/compile-fail/variadic-ffi-3.rs index 6e60562da6749..b43159b0d96b0 100644 --- a/src/test/compile-fail/variadic-ffi-3.rs +++ b/src/test/compile-fail/variadic-ffi-3.rs @@ -21,17 +21,15 @@ fn main() { let x: unsafe extern "C" fn(f: isize, x: u8) = foo; //~^ ERROR: mismatched types - //~| expected `unsafe extern "C" fn(isize, u8)` - //~| found `unsafe extern "C" fn(isize, u8, ...) {foo}` - //~| expected non-variadic fn - //~| found variadic function + //~| expected type `unsafe extern "C" fn(isize, u8)` + //~| found type `unsafe extern "C" fn(isize, u8, ...) {foo}` + //~| NOTE: expected non-variadic fn, found variadic function let y: extern "C" fn(f: isize, x: u8, ...) = bar; //~^ ERROR: mismatched types - //~| expected `extern "C" fn(isize, u8, ...)` - //~| found `extern "C" fn(isize, u8) {bar}` - //~| expected variadic fn - //~| found non-variadic function + //~| expected type `extern "C" fn(isize, u8, ...)` + //~| found type `extern "C" fn(isize, u8) {bar}` + //~| NOTE: expected variadic fn, found non-variadic function foo(1, 2, 3f32); //~ ERROR: can't pass an `f32` to variadic function, cast to `c_double` foo(1, 2, true); //~ ERROR: can't pass `bool` to variadic function, cast to `c_int`