]> git.proxmox.com Git - rustc.git/blob - src/test/ui/regions/region-object-lifetime-3.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / regions / region-object-lifetime-3.rs
1 // Various tests related to testing how region inference works
2 // with respect to the object receivers.
3
4 // build-pass (FIXME(62277): could be check-pass?)
5 #![allow(warnings)]
6
7 trait Foo {
8 fn borrowed<'a>(&'a self) -> &'a ();
9 }
10
11 // Borrowed receiver with two distinct lifetimes, but we know that
12 // 'b:'a, hence &'a () is permitted.
13 fn borrowed_receiver_related_lifetimes<'a,'b>(x: &'a (Foo+'b)) -> &'a () {
14 x.borrowed()
15 }
16
17
18 fn main() {}