]>
Commit | Line | Data |
---|---|---|
532ac7d7 | 1 | error: lifetime may not live long enough |
923072b8 | 2 | --> $DIR/type-check-pointer-comparisons.rs:4:5 |
532ac7d7 XL |
3 | | |
4 | LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) { | |
5 | | -- -- lifetime `'b` defined here | |
6 | | | | |
7 | | lifetime `'a` defined here | |
8 | LL | x == y; | |
9 | | ^ requires that `'a` must outlive `'b` | |
60c5eb7d XL |
10 | | |
11 | = help: consider adding the following bound: `'a: 'b` | |
04454e1e | 12 | = note: requirement occurs because of a mutable reference to `&i32` |
17df50a5 XL |
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 | |
532ac7d7 XL |
15 | |
16 | error: lifetime may not live long enough | |
923072b8 | 17 | --> $DIR/type-check-pointer-comparisons.rs:4:10 |
532ac7d7 XL |
18 | | |
19 | LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) { | |
20 | | -- -- lifetime `'b` defined here | |
21 | | | | |
22 | | lifetime `'a` defined here | |
23 | LL | x == y; | |
24 | | ^ requires that `'b` must outlive `'a` | |
60c5eb7d XL |
25 | | |
26 | = help: consider adding the following bound: `'b: 'a` | |
04454e1e | 27 | = note: requirement occurs because of a mutable reference to `&i32` |
17df50a5 XL |
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 | |
60c5eb7d XL |
30 | |
31 | help: `'a` and `'b` must be the same: replace one with the other | |
532ac7d7 XL |
32 | |
33 | error: lifetime may not live long enough | |
923072b8 | 34 | --> $DIR/type-check-pointer-comparisons.rs:10:5 |
532ac7d7 XL |
35 | | |
36 | LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) { | |
37 | | -- -- lifetime `'b` defined here | |
38 | | | | |
39 | | lifetime `'a` defined here | |
40 | LL | x == y; | |
41 | | ^ requires that `'a` must outlive `'b` | |
60c5eb7d XL |
42 | | |
43 | = help: consider adding the following bound: `'a: 'b` | |
04454e1e | 44 | = note: requirement occurs because of a mutable pointer to `&i32` |
17df50a5 XL |
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 | |
532ac7d7 XL |
47 | |
48 | error: lifetime may not live long enough | |
923072b8 | 49 | --> $DIR/type-check-pointer-comparisons.rs:10:10 |
532ac7d7 XL |
50 | | |
51 | LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) { | |
52 | | -- -- lifetime `'b` defined here | |
53 | | | | |
54 | | lifetime `'a` defined here | |
55 | LL | x == y; | |
56 | | ^ requires that `'b` must outlive `'a` | |
60c5eb7d XL |
57 | | |
58 | = help: consider adding the following bound: `'b: 'a` | |
04454e1e | 59 | = note: requirement occurs because of a mutable pointer to `&i32` |
17df50a5 XL |
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 | |
60c5eb7d XL |
62 | |
63 | help: `'a` and `'b` must be the same: replace one with the other | |
532ac7d7 XL |
64 | |
65 | error: lifetime may not live long enough | |
923072b8 | 66 | --> $DIR/type-check-pointer-comparisons.rs:16:5 |
532ac7d7 XL |
67 | | |
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 | |
70 | | | | |
71 | | lifetime `'a` defined here | |
72 | LL | f == g; | |
73 | | ^ requires that `'a` must outlive `'b` | |
60c5eb7d XL |
74 | | |
75 | = help: consider adding the following bound: `'a: 'b` | |
04454e1e | 76 | = note: requirement occurs because of a mutable reference to `&i32` |
17df50a5 XL |
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 | |
532ac7d7 XL |
79 | |
80 | error: lifetime may not live long enough | |
923072b8 | 81 | --> $DIR/type-check-pointer-comparisons.rs:16:10 |
532ac7d7 XL |
82 | | |
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 | |
85 | | | | |
86 | | lifetime `'a` defined here | |
87 | LL | f == g; | |
88 | | ^ requires that `'b` must outlive `'a` | |
60c5eb7d XL |
89 | | |
90 | = help: consider adding the following bound: `'b: 'a` | |
04454e1e | 91 | = note: requirement occurs because of a mutable reference to `&i32` |
17df50a5 XL |
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 | |
60c5eb7d XL |
94 | |
95 | help: `'a` and `'b` must be the same: replace one with the other | |
532ac7d7 XL |
96 | |
97 | error: aborting due to 6 previous errors | |
98 |