fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

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