]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/region-object-lifetime-1.rs
internally change regions to be covariant
[rust.git] / tests / ui / regions / region-object-lifetime-1.rs
1 // Various tests related to testing how region inference works
2 // with respect to the object receivers.
3
4 // check-pass
5 #![allow(warnings)]
6
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
17
18 fn main() {}