]> git.proxmox.com Git - rustc.git/blame - 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
CommitLineData
85aaf69f
SL
1// Various tests related to testing how region inference works
2// with respect to the object receivers.
223e47cc 3
416331ca 4// build-pass (FIXME(62277): could be check-pass?)
85aaf69f 5#![allow(warnings)]
223e47cc 6
85aaf69f
SL
7trait Foo {
8 fn borrowed<'a>(&'a self) -> &'a ();
9}
223e47cc 10
85aaf69f
SL
11// Borrowed receiver with two distinct lifetimes, but we know that
12// 'b:'a, hence &'a () is permitted.
13fn borrowed_receiver_related_lifetimes<'a,'b>(x: &'a (Foo+'b)) -> &'a () {
14 x.borrowed()
223e47cc 15}
85aaf69f 16
a1dfa0c6
XL
17
18fn main() {}