1 error: lifetime may not live long enough
2 --> $DIR/regions-infer-not-param.rs:15:54
4 LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
5 | -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
7 | lifetime `'a` defined here
9 = help: consider adding the following bound: `'a: 'b`
11 error: lifetime may not live long enough
12 --> $DIR/regions-infer-not-param.rs:20:63
14 LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
15 | -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
17 | lifetime `'a` defined here
19 = help: consider adding the following bound: `'b: 'a`
20 = note: requirement occurs because of the type `Indirect2<'_>`, which makes the generic argument `'_` invariant
21 = note: the struct `Indirect2<'a>` is invariant over the parameter `'a`
22 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
24 error: lifetime may not live long enough
25 --> $DIR/regions-infer-not-param.rs:20:63
27 LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
28 | -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
30 | lifetime `'a` defined here
32 = help: consider adding the following bound: `'a: 'b`
33 = note: requirement occurs because of the type `Indirect2<'_>`, which makes the generic argument `'_` invariant
34 = note: the struct `Indirect2<'a>` is invariant over the parameter `'a`
35 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
37 help: `'b` and `'a` must be the same: replace one with the other
39 error: aborting due to 3 previous errors