blob: 1c867bd2378d04f3b4d7896e7e55f182f52a9ab1 [file] [log] [blame] [edit]
// Don't ICE when trying to annotate signature and we see `&()`
fn f<'a, T>(_: &'static &'a (), x: &'a T) -> &'static T {
x
}
trait W<'a> {
fn g<T>(self, x: &'a T) -> &'static T;
}
// Frankly this error message is impossible to parse, but :shrug:.
impl<'a> W<'a> for &'static () {
fn g<T>(self, x: &'a T) -> &'static T {
f(&self, x)
//~^ ERROR borrowed data escapes outside of method
//~| ERROR `self` does not live long enough
}
}
fn main() {}