]>
Commit | Line | Data |
---|---|---|
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 |
7 | trait 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. | |
13 | fn borrowed_receiver_related_lifetimes<'a,'b>(x: &'a (Foo+'b)) -> &'a () { | |
14 | x.borrowed() | |
223e47cc | 15 | } |
85aaf69f | 16 | |
a1dfa0c6 XL |
17 | |
18 | fn main() {} |