2015-02-12 08:37:52 -06:00
|
|
|
// Various tests related to testing how region inference works
|
|
|
|
// with respect to the object receivers.
|
|
|
|
|
2020-10-30 09:34:12 -05:00
|
|
|
// check-pass
|
2015-02-12 08:37:52 -06:00
|
|
|
#![allow(warnings)]
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
fn borrowed<'a>(&'a self) -> &'a ();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Borrowed receiver with two distinct lifetimes, but we know that
|
|
|
|
// 'b:'a, hence &'a () is permitted.
|
|
|
|
fn borrowed_receiver_related_lifetimes<'a,'b>(x: &'a (Foo+'b)) -> &'a () {
|
|
|
|
x.borrowed()
|
|
|
|
}
|
|
|
|
|
2018-10-31 07:08:01 -05:00
|
|
|
|
|
|
|
fn main() {}
|