mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
27 lines
1.1 KiB
Plaintext
27 lines
1.1 KiB
Plaintext
|
error: lifetime may not live long enough
|
||
|
--> $DIR/regions-infer-not-param.rs:15:54
|
||
|
|
|
||
|
LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
|
||
|
| -- -- lifetime `'b` defined here ^ returning this value requires that `'a` must outlive `'b`
|
||
|
| |
|
||
|
| lifetime `'a` defined here
|
||
|
|
||
|
error: lifetime may not live long enough
|
||
|
--> $DIR/regions-infer-not-param.rs:19:63
|
||
|
|
|
||
|
LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
|
||
|
| -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||
|
| |
|
||
|
| lifetime `'a` defined here
|
||
|
|
||
|
error: lifetime may not live long enough
|
||
|
--> $DIR/regions-infer-not-param.rs:19:63
|
||
|
|
|
||
|
LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
|
||
|
| -- -- lifetime `'b` defined here ^ returning this value requires that `'a` must outlive `'b`
|
||
|
| |
|
||
|
| lifetime `'a` defined here
|
||
|
|
||
|
error: aborting due to 3 previous errors
|
||
|
|