]> git.proxmox.com Git - rustc.git/blame - src/test/ui/regions/region-object-lifetime-1.rs
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / regions / region-object-lifetime-1.rs
CommitLineData
1a4d82fc
JJ
1// Various tests related to testing how region inference works
2// with respect to the object receivers.
3
29967ef6 4// check-pass
85aaf69f
SL
5#![allow(warnings)]
6
1a4d82fc
JJ
7trait Foo {
8 fn borrowed<'a>(&'a self) -> &'a ();
9}
10
11// Here the receiver and return value all have the same lifetime,
12// so no error results.
13fn borrowed_receiver_same_lifetime<'a>(x: &'a Foo) -> &'a () {
14 x.borrowed()
15}
16
a1dfa0c6
XL
17
18fn main() {}