1 error: lifetime may not live long enough
2 --> $DIR/type-check-pointer-coercions.rs:4:5
4 LL | fn shared_to_const<'a, 'b>(x: &&'a i32) -> *const &'b i32 {
5 | -- -- lifetime `'b` defined here
7 | lifetime `'a` defined here
9 | ^ returning this value requires that `'a` must outlive `'b`
11 error: lifetime may not live long enough
12 --> $DIR/type-check-pointer-coercions.rs:8:5
14 LL | fn unique_to_const<'a, 'b>(x: &mut &'a i32) -> *const &'b i32 {
15 | -- -- lifetime `'b` defined here
17 | lifetime `'a` defined here
19 | ^ returning this value requires that `'a` must outlive `'b`
21 error: lifetime may not live long enough
22 --> $DIR/type-check-pointer-coercions.rs:13:5
24 LL | fn unique_to_mut<'a, 'b>(x: &mut &'a i32) -> *mut &'b i32 {
25 | -- -- lifetime `'b` defined here
27 | lifetime `'a` defined here
28 LL | // Two errors because *mut is invariant
30 | ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
32 error: lifetime may not live long enough
33 --> $DIR/type-check-pointer-coercions.rs:13:5
35 LL | fn unique_to_mut<'a, 'b>(x: &mut &'a i32) -> *mut &'b i32 {
36 | -- -- lifetime `'b` defined here
38 | lifetime `'a` defined here
39 LL | // Two errors because *mut is invariant
41 | ^ returning this value requires that `'a` must outlive `'b`
43 error: lifetime may not live long enough
44 --> $DIR/type-check-pointer-coercions.rs:18:5
46 LL | fn mut_to_const<'a, 'b>(x: *mut &'a i32) -> *const &'b i32 {
47 | -- -- lifetime `'b` defined here
49 | lifetime `'a` defined here
51 | ^ returning this value requires that `'a` must outlive `'b`
53 error: lifetime may not live long enough
54 --> $DIR/type-check-pointer-coercions.rs:24:5
56 LL | fn array_elem<'a, 'b>(x: &'a i32) -> *const &'b i32 {
57 | -- -- lifetime `'b` defined here
59 | lifetime `'a` defined here
62 | ^ returning this value requires that `'a` must outlive `'b`
64 error: lifetime may not live long enough
65 --> $DIR/type-check-pointer-coercions.rs:30:5
67 LL | fn array_coerce<'a, 'b>(x: &'a i32) -> *const [&'b i32; 3] {
68 | -- -- lifetime `'b` defined here
70 | lifetime `'a` defined here
73 | ^ returning this value requires that `'a` must outlive `'b`
75 error: lifetime may not live long enough
76 --> $DIR/type-check-pointer-coercions.rs:36:5
78 LL | fn nested_array<'a, 'b>(x: &'a i32) -> *const [&'b i32; 2] {
79 | -- -- lifetime `'b` defined here
81 | lifetime `'a` defined here
84 | ^ returning this value requires that `'a` must outlive `'b`
86 error: aborting due to 8 previous errors