]>
Commit | Line | Data |
---|---|---|
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 |
7 | trait 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. | |
13 | fn borrowed_receiver_same_lifetime<'a>(x: &'a Foo) -> &'a () { | |
14 | x.borrowed() | |
15 | } | |
16 | ||
a1dfa0c6 XL |
17 | |
18 | fn main() {} |