fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
1.1 KiB30 linesraw
1error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
2  --> $DIR/region-object-lifetime-4.rs:12:7
3   |
4LL |     x.borrowed()
5   |       ^^^^^^^^
6   |
7note: 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   |
10LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () {
11   |                                         ^^
12note: ...so that reference does not outlive borrowed content
13  --> $DIR/region-object-lifetime-4.rs:12:5
14   |
15LL |     x.borrowed()
16   |     ^
17note: 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   |
20LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (dyn Foo + 'b)) -> &'b () {
21   |                                            ^^
22note: ...so that reference does not outlive borrowed content
23  --> $DIR/region-object-lifetime-4.rs:12:5
24   |
25LL |     x.borrowed()
26   |     ^^^^^^^^^^^^
27
28error: aborting due to previous error
29
30For more information about this error, try `rustc --explain E0495`.