2015-02-12 09:37:52 -05:00
|
|
|
// Various tests related to testing how region inference works
|
|
|
|
// with respect to the object receivers.
|
|
|
|
|
2020-10-30 23:34:12 +09:00
|
|
|
//@ check-pass
|
2015-02-12 09:37:52 -05: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 13:08:01 +01:00
|
|
|
|
|
|
|
fn main() {}
|