Adjust error messages due to having more type information available.
This commit is contained in:
parent
45e5627ef9
commit
8d6786cd6c
@ -40,8 +40,8 @@ impl Car for ModelU { }
|
||||
|
||||
fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
|
||||
fn a() { dent(ModelT, Black); }
|
||||
fn b() { dent(ModelT, Blue); } //~ ERROR type mismatch
|
||||
fn c() { dent(ModelU, Black); } //~ ERROR type mismatch
|
||||
fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types
|
||||
fn c() { dent(ModelU, Black); } //~ ERROR mismatched types
|
||||
fn d() { dent(ModelU, Blue); }
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -25,7 +25,7 @@ pub fn f2<T: Foo>(a: T) -> T::A {
|
||||
|
||||
pub fn f1_int_int() {
|
||||
f1(2is, 4is);
|
||||
//~^ ERROR type mismatch resolving
|
||||
//~^ ERROR mismatched types
|
||||
//~| expected usize
|
||||
//~| found isize
|
||||
}
|
||||
@ -51,8 +51,6 @@ pub fn f2_int() {
|
||||
//~^ ERROR mismatched types
|
||||
//~| expected `isize`
|
||||
//~| found `usize`
|
||||
//~| expected isize
|
||||
//~| found usize
|
||||
}
|
||||
|
||||
pub fn main() { }
|
||||
|
@ -32,5 +32,8 @@ fn main() {
|
||||
let bits: &[_] = &[0, 1];
|
||||
|
||||
0.contains(bits);
|
||||
//~^ ERROR the trait `Set<_>` is not implemented for the type `_`
|
||||
//~^ ERROR overflow
|
||||
//~| ERROR overflow
|
||||
//~| ERROR overflow
|
||||
//~| ERROR mismatched types
|
||||
}
|
||||
|
@ -16,6 +16,6 @@ impl Bar {
|
||||
|
||||
#[derive(Hash)]
|
||||
struct Foo(Bar);
|
||||
//~^ error: the trait `core::hash::Hash<__S>` is not implemented for the type `Bar`
|
||||
//~^ error: the trait `core::hash::Hash<_>` is not implemented for the type `Bar`
|
||||
|
||||
fn main() {}
|
||||
|
@ -29,7 +29,7 @@ fn foo(p: &Panolpy) {
|
||||
// known to be an integer, but meh.
|
||||
let x;
|
||||
22 >> x;
|
||||
//~^ ERROR right-hand-side of a shift operation must have integral type
|
||||
//~^ ERROR the type of this value must be known in this context
|
||||
|
||||
22 >> 1;
|
||||
// Integer literal types are OK
|
||||
|
@ -13,9 +13,10 @@
|
||||
fn main() {
|
||||
let x: &[isize] = &[1, 2, 3, 4, 5];
|
||||
// Immutable slices are not mutable.
|
||||
|
||||
let y: &mut[_] = &x[2..4];
|
||||
//~^ ERROR mismatched types
|
||||
//~| expected `&mut [_]`
|
||||
//~| found `&_`
|
||||
//~| found `&[isize]`
|
||||
//~| values differ in mutability
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ where T : Convert<U>
|
||||
}
|
||||
|
||||
fn a() {
|
||||
test(22is, 44is); //~ ERROR not implemented
|
||||
test(22is, 44is); //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -45,7 +45,7 @@ fn desugared_for_loop_bad<T>(v: Vec<T>) {
|
||||
}
|
||||
|
||||
fn desugared_for_loop_good<T>(v: Vec<T>) {
|
||||
match v.iter().into_iter() { // NB method call instead of UFCS
|
||||
match v.iter().into_iter() {
|
||||
mut iter => {
|
||||
loop {
|
||||
match ::std::iter::Iterator::next(&mut iter) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user