1 // Various tests related to testing how region inference works
2 // with respect to the object receivers.
5 fn borrowed<'a>(&'a self) -> &'a ();
8 // Here, the object is bounded by an anonymous lifetime and returned
9 // as `&'static`, so you get an error.
10 fn owned_receiver(x: Box<dyn Foo>) -> &'static () {
11 x.borrowed() //~ ERROR cannot return reference to local data `*x`