1
Fork 0

fallout in tests

in some cases we give more specific messages or fewer
duplicates, now that we have cache and make fewer region variables
This commit is contained in:
Niko Matsakis 2016-05-21 08:32:40 -04:00
parent ad97f296d3
commit 136a83ad4d
7 changed files with 6 additions and 11 deletions

View file

@ -28,7 +28,7 @@ impl<'a> Test<'a> for Foo<'a> {
impl<'a> NoLifetime for Foo<'a> {
fn get<'p, T : Test<'a>>(&self) -> T {
//~^ ERROR lifetime parameters or bounds on method `get` do not match the trait declaration
//~^ ERROR E0195
return *self as T;
}
}

View file

@ -39,7 +39,6 @@ impl<'a> Publisher<'a> for MyStruct<'a> {
// Not obvious, but there is an implicit lifetime here -------^
//~^^ ERROR cannot infer
//~| ERROR cannot infer
//~| ERROR cannot infer
//
// The fact that `Publisher` is using an implicit lifetime is
// what was causing the debruijn accounting to be off, so

View file

@ -14,7 +14,7 @@ use std::marker::PhantomData;
struct Bar<'x, 'y, 'z> { bar: &'y i32, baz: i32, marker: PhantomData<(&'x(),&'y(),&'z())> }
fn bar1<'a>(x: &Bar) -> (&'a i32, &'a i32, &'a i32) {
//~^ HELP: consider using an explicit lifetime parameter as shown: fn bar1<'a>(x: &'a Bar) -> (&'a i32, &'a i32, &'a i32)
//~^ HELP consider using an explicit lifetime parameter as shown: fn bar1<'b, 'c, 'a>(x: &'a Bar<'b, 'a, 'c>) -> (&'a i32, &'a i32, &'a i32)
(x.bar, &x.baz, &x.baz)
//~^ ERROR E0312
//~| ERROR cannot infer

View file

@ -49,7 +49,7 @@ struct Baz<'x> {
impl<'a> Baz<'a> {
fn baz2<'b>(&self, x: &isize) -> (&'b isize, &'b isize) {
//~^ HELP consider using an explicit lifetime parameter as shown: fn baz2<'b>(&self, x: &'b isize) -> (&'a isize, &'a isize)
//~^ HELP consider using an explicit lifetime parameter as shown: fn baz2<'b>(&self, x: &'a isize) -> (&'a isize, &'a isize)
(self.bar, x) //~ ERROR E0312
//~^ ERROR E0312
}

View file

@ -28,11 +28,7 @@ impl<'a> GetRef<'a> for Box<'a> {
impl<'a> Box<'a> {
fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize {
g2.get()
//~^ ERROR mismatched types
//~| expected type `&'a isize`
//~| found type `&'b isize`
//~| lifetime mismatch
//~^ ERROR E0312
}
}

View file

@ -27,7 +27,7 @@ impl<'a,T:Clone> GetRef<'a,T> for Box<'a,T> {
fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize {
g1.get()
//~^ ERROR mismatched types
//~^ ERROR E0312
}
fn main() {

View file

@ -10,7 +10,7 @@
struct Invariant<'a> {
f: Box<for<'b> FnOnce() -> &'b mut &'a isize + 'static>,
f: Box<FnOnce() -> *mut &'a isize + 'static>,
}
fn to_same_lifetime<'r>(b_isize: Invariant<'r>) {