]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/region-object-lifetime-4.stderr
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / regions / region-object-lifetime-4.stderr
1 error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
2   --> $DIR/region-object-lifetime-4.rs:12:7
3    |
4 LL |     x.borrowed() //~ ERROR cannot infer
5    |       ^^^^^^^^
6    |
7 note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 11:41...
8   --> $DIR/region-object-lifetime-4.rs:11:41
9    |
10 LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (Foo+'b)) -> &'b () {
11    |                                         ^^
12 note: ...so that reference does not outlive borrowed content
13   --> $DIR/region-object-lifetime-4.rs:12:5
14    |
15 LL |     x.borrowed() //~ ERROR cannot infer
16    |     ^
17 note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 11:44...
18   --> $DIR/region-object-lifetime-4.rs:11:44
19    |
20 LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (Foo+'b)) -> &'b () {
21    |                                            ^^
22 note: ...so that reference does not outlive borrowed content
23   --> $DIR/region-object-lifetime-4.rs:12:5
24    |
25 LL |     x.borrowed() //~ ERROR cannot infer
26    |     ^^^^^^^^^^^^
27
28 error: aborting due to previous error
29
30 For more information about this error, try `rustc --explain E0495`.