]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/region-object-lifetime-2.stderr
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / regions / region-object-lifetime-2.stderr
1 error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
2   --> $DIR/region-object-lifetime-2.rs:10: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 9:42...
8   --> $DIR/region-object-lifetime-2.rs:9:42
9    |
10 LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a Foo) -> &'b () {
11    |                                          ^^
12 note: ...so that reference does not outlive borrowed content
13   --> $DIR/region-object-lifetime-2.rs:10: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 9:45...
18   --> $DIR/region-object-lifetime-2.rs:9:45
19    |
20 LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a Foo) -> &'b () {
21    |                                             ^^
22 note: ...so that reference does not outlive borrowed content
23   --> $DIR/region-object-lifetime-2.rs:10: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`.