2019-01-27 05:03:21 -06:00
|
|
|
error: lifetime may not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/regions-infer-not-param.rs:15:54
|
2019-01-27 05:03:21 -06:00
|
|
|
|
|
|
|
|
LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
|
2021-12-31 15:55:34 -06:00
|
|
|
| -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
2019-01-27 05:03:21 -06:00
|
|
|
| |
|
|
|
|
| lifetime `'a` defined here
|
2019-10-27 09:39:14 -05:00
|
|
|
|
|
|
|
|
= help: consider adding the following bound: `'a: 'b`
|
2019-01-27 05:03:21 -06:00
|
|
|
|
|
|
|
error: lifetime may not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/regions-infer-not-param.rs:20:63
|
2019-01-27 05:03:21 -06:00
|
|
|
|
|
|
|
|
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
|
2019-10-27 09:39:14 -05:00
|
|
|
|
|
|
|
|
= help: consider adding the following bound: `'b: 'a`
|
2022-04-02 17:32:39 -05:00
|
|
|
= note: requirement occurs because of the type `Indirect2<'_>`, which makes the generic argument `'_` invariant
|
|
|
|
= note: the struct `Indirect2<'a>` is invariant over the parameter `'a`
|
2021-09-27 20:22:44 -05:00
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2019-01-27 05:03:21 -06:00
|
|
|
|
|
|
|
error: lifetime may not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/regions-infer-not-param.rs:20:63
|
2019-01-27 05:03:21 -06:00
|
|
|
|
|
|
|
|
LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
|
2021-12-31 15:55:34 -06:00
|
|
|
| -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
2019-01-27 05:03:21 -06:00
|
|
|
| |
|
|
|
|
| lifetime `'a` defined here
|
2019-10-27 09:39:14 -05:00
|
|
|
|
|
|
|
|
= help: consider adding the following bound: `'a: 'b`
|
2022-04-02 17:32:39 -05:00
|
|
|
= note: requirement occurs because of the type `Indirect2<'_>`, which makes the generic argument `'_` invariant
|
|
|
|
= note: the struct `Indirect2<'a>` is invariant over the parameter `'a`
|
2021-09-27 20:22:44 -05:00
|
|
|
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
|
2019-10-27 09:39:14 -05:00
|
|
|
|
|
|
|
help: `'b` and `'a` must be the same: replace one with the other
|
2019-01-27 05:03:21 -06:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|