Skip to content

Commit 8d6786c

Browse files
committed
Adjust error messages due to having more type information available.
1 parent 45e5627 commit 8d6786c

8 files changed

+13
-11
lines changed

Diff for: src/test/compile-fail/associated-type-projection-from-supertrait.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ impl Car for ModelU { }
4040

4141
fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
4242
fn a() { dent(ModelT, Black); }
43-
fn b() { dent(ModelT, Blue); } //~ ERROR type mismatch
44-
fn c() { dent(ModelU, Black); } //~ ERROR type mismatch
43+
fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types
44+
fn c() { dent(ModelU, Black); } //~ ERROR mismatched types
4545
fn d() { dent(ModelU, Blue); }
4646

4747
///////////////////////////////////////////////////////////////////////////

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn f2<T: Foo>(a: T) -> T::A {
2525

2626
pub fn f1_int_int() {
2727
f1(2is, 4is);
28-
//~^ ERROR type mismatch resolving
28+
//~^ ERROR mismatched types
2929
//~| expected usize
3030
//~| found isize
3131
}
@@ -51,8 +51,6 @@ pub fn f2_int() {
5151
//~^ ERROR mismatched types
5252
//~| expected `isize`
5353
//~| found `usize`
54-
//~| expected isize
55-
//~| found usize
5654
}
5755

5856
pub fn main() { }

Diff for: src/test/compile-fail/issue-18400.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@ fn main() {
3232
let bits: &[_] = &[0, 1];
3333

3434
0.contains(bits);
35-
//~^ ERROR the trait `Set<_>` is not implemented for the type `_`
35+
//~^ ERROR overflow
36+
//~| ERROR overflow
37+
//~| ERROR overflow
38+
//~| ERROR mismatched types
3639
}

Diff for: src/test/compile-fail/issue-21160.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ impl Bar {
1616

1717
#[derive(Hash)]
1818
struct Foo(Bar);
19-
//~^ error: the trait `core::hash::Hash<__S>` is not implemented for the type `Bar`
19+
//~^ error: the trait `core::hash::Hash<_>` is not implemented for the type `Bar`
2020

2121
fn main() {}

Diff for: src/test/compile-fail/shift-various-bad-types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn foo(p: &Panolpy) {
2929
// known to be an integer, but meh.
3030
let x;
3131
22 >> x;
32-
//~^ ERROR right-hand-side of a shift operation must have integral type
32+
//~^ ERROR the type of this value must be known in this context
3333

3434
22 >> 1;
3535
// Integer literal types are OK

Diff for: src/test/compile-fail/slice-mut.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
fn main() {
1414
let x: &[isize] = &[1, 2, 3, 4, 5];
1515
// Immutable slices are not mutable.
16+
1617
let y: &mut[_] = &x[2..4];
1718
//~^ ERROR mismatched types
1819
//~| expected `&mut [_]`
19-
//~| found `&_`
20+
//~| found `&[isize]`
2021
//~| values differ in mutability
2122
}

Diff for: src/test/compile-fail/traits-multidispatch-bad.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ where T : Convert<U>
2626
}
2727

2828
fn a() {
29-
test(22is, 44is); //~ ERROR not implemented
29+
test(22is, 44is); //~ ERROR mismatched types
3030
}
3131

3232
fn main() {}

Diff for: src/test/run-pass/issue-21245.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn desugared_for_loop_bad<T>(v: Vec<T>) {
4545
}
4646

4747
fn desugared_for_loop_good<T>(v: Vec<T>) {
48-
match v.iter().into_iter() { // NB method call instead of UFCS
48+
match v.iter().into_iter() {
4949
mut iter => {
5050
loop {
5151
match ::std::iter::Iterator::next(&mut iter) {

0 commit comments

Comments
 (0)