]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/region-object-lifetime-2.rs
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / regions / region-object-lifetime-2.rs
1 // Various tests related to testing how region inference works
2 // with respect to the object receivers.
3
4 trait Foo {
5     fn borrowed<'a>(&'a self) -> &'a ();
6 }
7
8 // Borrowed receiver but two distinct lifetimes, we get an error.
9 fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a Foo) -> &'b () {
10     x.borrowed() //~ ERROR cannot infer
11 }
12
13 fn main() {}