now that we've fixed the bug where constraint origins were getting overwritten, the good error messages are back (with some tweaks)
-//~ ERROR mismatched types
-//~| ERROR mismatched types
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
}
impl<'a,'b> Foo<'a,'b> {
- fn bar(self: Foo<'b,'a>) {}
+ fn bar(self:
+ Foo<'b,'a>
+ //~^ ERROR mismatched method receiver
+ //~| expected type `Foo<'a, 'b>`
+ //~| found type `Foo<'b, 'a>`
+ //~| lifetime mismatch
+ //~| ERROR mismatched method receiver
+ //~| expected type `Foo<'a, 'b>`
+ //~| found type `Foo<'b, 'a>`
+ //~| lifetime mismatch
+ ) {}
}
fn main() {}
-//~ ERROR mismatched types
-//~| ERROR mismatched types
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
impl <'a> Foo<'a>{
fn bar(self: &mut Foo) {
+ //~^ mismatched method receiver
+ //~| expected type `Foo<'a>`
+ //~| found type `Foo<'_>`
+ //~| lifetime mismatch
+ //~| mismatched method receiver
+ //~| expected type `Foo<'a>`
+ //~| found type `Foo<'_>`
+ //~| lifetime mismatch
}
}
-//~ ERROR mismatched types
-//~| ERROR mismatched types
-//~| ERROR mismatched types
-//~| ERROR mismatched types
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
impl<'a, T> SomeTrait for &'a Bar<T> {
fn dummy1(self: &&'a Bar<T>) { }
- fn dummy2(self: &Bar<T>) {}
+ fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver
+ //~^ ERROR mismatched method receiver
fn dummy3(self: &&Bar<T>) {}
+ //~^ ERROR mismatched method receiver
+ //~| expected type `&'a Bar<T>`
+ //~| found type `&Bar<T>`
+ //~| lifetime mismatch
+ //~| ERROR mismatched method receiver
+ //~| expected type `&'a Bar<T>`
+ //~| found type `&Bar<T>`
+ //~| lifetime mismatch
}
fn main() {