struct Dog<'y> { dog: &'y isize }
fn cat2<'x, 'y>(x: Cat<'x, Dog<'y>>) -> &'x isize {
-//~^ HELP: consider using an explicit lifetime parameter as shown: fn cat2<'x>(x: Cat<'x, Dog<'x>>) -> &'x isize
- x.t.dog //~ ERROR: cannot infer
+ //~^ HELP consider using an explicit lifetime parameter as shown: fn cat2<'x>(x: Cat<'x, Dog<'x>>) -> &'x isize
+ x.t.dog //~ ERROR E0312
}
struct Baz<'x> {
impl<'a> Baz<'a> {
fn baz2<'b>(&self, x: &isize) -> (&'b isize, &'b isize) {
- //~^ HELP: parameter as shown: fn baz2<'b>(&self, x: &'b isize) -> (&'a isize, &'a isize)
- // The lifetime that gets assigned to `x` seems somewhat random.
- // I have disabled this test for the time being. --pcwalton
- (self.bar, x) //~ ERROR: cannot infer
- //~^ ERROR: cannot infer
+ //~^ HELP consider using an explicit lifetime parameter as shown: fn baz2<'b>(&self, x: &'b isize) -> (&'a isize, &'a isize)
+ (self.bar, x) //~ ERROR E0312
+ //~^ ERROR E0312
}
}