1 // Check that when we clone a `&T` pointer we properly relate the
2 // lifetime of the pointer which results to the pointer being cloned.
3 // Bugs in method resolution have sometimes broken this connection.
6 fn leak<'a, T>(x: T) -> &'a T {
7 (&x).clone() //~ ERROR cannot return value referencing function parameter `x`