2015-02-12 09:37:52 -05:00
|
|
|
// Various tests related to testing how region inference works
|
|
|
|
// with respect to the object receivers.
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
fn borrowed<'a>(&'a self) -> &'a ();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Borrowed receiver but two distinct lifetimes, we get an error.
|
2019-05-28 14:46:13 -04:00
|
|
|
fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () {
|
2022-04-19 12:56:18 +02:00
|
|
|
x.borrowed()
|
2022-04-01 13:13:25 -04:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
2015-02-12 09:37:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|