1 error: lifetime may not live long enough
2 --> $DIR/type-check-pointer-comparisons.rs:6:5
4 LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) {
5 | -- -- lifetime `'b` defined here
7 | lifetime `'a` defined here
9 | ^ requires that `'a` must outlive `'b`
11 = help: consider adding the following bound: `'a: 'b`
12 = note: requirement occurs because of a mutable reference to `&i32`
13 = note: mutable references are invariant over their type parameter
14 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
16 error: lifetime may not live long enough
17 --> $DIR/type-check-pointer-comparisons.rs:6:10
19 LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) {
20 | -- -- lifetime `'b` defined here
22 | lifetime `'a` defined here
24 | ^ requires that `'b` must outlive `'a`
26 = help: consider adding the following bound: `'b: 'a`
27 = note: requirement occurs because of a mutable reference to `&i32`
28 = note: mutable references are invariant over their type parameter
29 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
31 help: `'a` and `'b` must be the same: replace one with the other
33 error: lifetime may not live long enough
34 --> $DIR/type-check-pointer-comparisons.rs:12:5
36 LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) {
37 | -- -- lifetime `'b` defined here
39 | lifetime `'a` defined here
41 | ^ requires that `'a` must outlive `'b`
43 = help: consider adding the following bound: `'a: 'b`
44 = note: requirement occurs because of a mutable pointer to `&i32`
45 = note: mutable pointers are invariant over their type parameter
46 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
48 error: lifetime may not live long enough
49 --> $DIR/type-check-pointer-comparisons.rs:12:10
51 LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) {
52 | -- -- lifetime `'b` defined here
54 | lifetime `'a` defined here
56 | ^ requires that `'b` must outlive `'a`
58 = help: consider adding the following bound: `'b: 'a`
59 = note: requirement occurs because of a mutable pointer to `&i32`
60 = note: mutable pointers are invariant over their type parameter
61 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
63 help: `'a` and `'b` must be the same: replace one with the other
65 error: lifetime may not live long enough
66 --> $DIR/type-check-pointer-comparisons.rs:18:5
68 LL | fn compare_fn_ptr<'a, 'b, 'c>(f: fn(&'c mut &'a i32), g: fn(&'c mut &'b i32)) {
69 | -- -- lifetime `'b` defined here
71 | lifetime `'a` defined here
73 | ^ requires that `'a` must outlive `'b`
75 = help: consider adding the following bound: `'a: 'b`
76 = note: requirement occurs because of a mutable reference to `&i32`
77 = note: mutable references are invariant over their type parameter
78 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
80 error: lifetime may not live long enough
81 --> $DIR/type-check-pointer-comparisons.rs:18:10
83 LL | fn compare_fn_ptr<'a, 'b, 'c>(f: fn(&'c mut &'a i32), g: fn(&'c mut &'b i32)) {
84 | -- -- lifetime `'b` defined here
86 | lifetime `'a` defined here
88 | ^ requires that `'b` must outlive `'a`
90 = help: consider adding the following bound: `'b: 'a`
91 = note: requirement occurs because of a mutable reference to `&i32`
92 = note: mutable references are invariant over their type parameter
93 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
95 help: `'a` and `'b` must be the same: replace one with the other
97 error: aborting due to 6 previous errors