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 KiB26 linesraw
1error: lifetime may not live long enough
2  --> $DIR/regions-infer-not-param.rs:15:54
3   |
4LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
5   |                -- -- lifetime `'b` defined here      ^ returning this value requires that `'a` must outlive `'b`
6   |                |
7   |                lifetime `'a` defined here
8
9error: lifetime may not live long enough
10  --> $DIR/regions-infer-not-param.rs:19:63
11   |
12LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
13   |                   -- -- lifetime `'b` defined here            ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
14   |                   |
15   |                   lifetime `'a` defined here
16
17error: lifetime may not live long enough
18  --> $DIR/regions-infer-not-param.rs:19:63
19   |
20LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
21   |                   -- -- lifetime `'b` defined here            ^ returning this value requires that `'a` must outlive `'b`
22   |                   |
23   |                   lifetime `'a` defined here
24
25error: aborting due to 3 previous errors
26