@@ -6,24 +6,24 @@ LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) {
66 | |
77 | lifetime `'a` defined here
88LL | x == y;
9- | ^ requires that `'b ` must outlive `'a `
9+ | ^^^^^^ argument requires that `'a ` must outlive `'b `
1010 |
11- = help: consider adding the following bound: `'b : 'a `
11+ = help: consider adding the following bound: `'a : 'b `
1212 = note: requirement occurs because of a mutable reference to `&i32`
1313 = note: mutable references are invariant over their type parameter
1414 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
1515
1616error: lifetime may not live long enough
17- --> $DIR/type-check-pointer-comparisons.rs:4:10
17+ --> $DIR/type-check-pointer-comparisons.rs:4:5
1818 |
1919LL | fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) {
2020 | -- -- lifetime `'b` defined here
2121 | |
2222 | lifetime `'a` defined here
2323LL | x == y;
24- | ^ requires that `'a ` must outlive `'b `
24+ | ^^^^^^ argument requires that `'b ` must outlive `'a `
2525 |
26- = help: consider adding the following bound: `'a : 'b `
26+ = help: consider adding the following bound: `'b : 'a `
2727 = note: requirement occurs because of a mutable reference to `&i32`
2828 = note: mutable references are invariant over their type parameter
2929 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
@@ -38,24 +38,24 @@ LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) {
3838 | |
3939 | lifetime `'a` defined here
4040LL | x == y;
41- | ^ requires that `'b ` must outlive `'a `
41+ | ^^^^^^ argument requires that `'a ` must outlive `'b `
4242 |
43- = help: consider adding the following bound: `'b : 'a `
43+ = help: consider adding the following bound: `'a : 'b `
4444 = note: requirement occurs because of a mutable pointer to `&i32`
4545 = note: mutable pointers are invariant over their type parameter
4646 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
4747
4848error: lifetime may not live long enough
49- --> $DIR/type-check-pointer-comparisons.rs:10:10
49+ --> $DIR/type-check-pointer-comparisons.rs:10:5
5050 |
5151LL | fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) {
5252 | -- -- lifetime `'b` defined here
5353 | |
5454 | lifetime `'a` defined here
5555LL | x == y;
56- | ^ requires that `'a ` must outlive `'b `
56+ | ^^^^^^ argument requires that `'b ` must outlive `'a `
5757 |
58- = help: consider adding the following bound: `'a : 'b `
58+ = help: consider adding the following bound: `'b : 'a `
5959 = note: requirement occurs because of a mutable pointer to `&i32`
6060 = note: mutable pointers are invariant over their type parameter
6161 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
@@ -72,24 +72,24 @@ LL | fn compare_fn_ptr<'a, 'b, 'c>(f: fn(&'c mut &'a i32), g: fn(&'c mut &'b i32
7272 | |
7373 | lifetime `'a` defined here
7474LL | f == g;
75- | ^ requires that `'b ` must outlive `'a `
75+ | ^^^^^^ argument requires that `'a ` must outlive `'b `
7676 |
77- = help: consider adding the following bound: `'b : 'a `
77+ = help: consider adding the following bound: `'a : 'b `
7878 = note: requirement occurs because of a mutable reference to `&i32`
7979 = note: mutable references are invariant over their type parameter
8080 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
8181
8282error: lifetime may not live long enough
83- --> $DIR/type-check-pointer-comparisons.rs:16:10
83+ --> $DIR/type-check-pointer-comparisons.rs:16:5
8484 |
8585LL | fn compare_fn_ptr<'a, 'b, 'c>(f: fn(&'c mut &'a i32), g: fn(&'c mut &'b i32)) {
8686 | -- -- lifetime `'b` defined here
8787 | |
8888 | lifetime `'a` defined here
8989LL | f == g;
90- | ^ requires that `'a ` must outlive `'b `
90+ | ^^^^^^ argument requires that `'b ` must outlive `'a `
9191 |
92- = help: consider adding the following bound: `'a : 'b `
92+ = help: consider adding the following bound: `'b : 'a `
9393 = note: requirement occurs because of a mutable reference to `&i32`
9494 = note: mutable references are invariant over their type parameter
9595 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
0 commit comments