fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
2.2 KiB54 linesraw
1error[E0491]: in type `&'b &'a usize`, reference has a longer lifetime than the data it references
2  --> $DIR/regions-free-region-ordering-caller.rs:11:12
3   |
4LL |     let z: Option<&'b &'a usize> = None;
5   |            ^^^^^^^^^^^^^^^^^^^^^
6   |
7note: the pointer is valid for the lifetime `'b` as defined on the function body at 10:14
8  --> $DIR/regions-free-region-ordering-caller.rs:10:14
9   |
10LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) {
11   |              ^^
12note: but the referenced data is only valid for the lifetime `'a` as defined on the function body at 10:10
13  --> $DIR/regions-free-region-ordering-caller.rs:10:10
14   |
15LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) {
16   |          ^^
17
18error[E0491]: in type `&'b Paramd<'a>`, reference has a longer lifetime than the data it references
19  --> $DIR/regions-free-region-ordering-caller.rs:17:12
20   |
21LL |     let z: Option<&'b Paramd<'a>> = None;
22   |            ^^^^^^^^^^^^^^^^^^^^^^
23   |
24note: the pointer is valid for the lifetime `'b` as defined on the function body at 15:14
25  --> $DIR/regions-free-region-ordering-caller.rs:15:14
26   |
27LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) {
28   |              ^^
29note: but the referenced data is only valid for the lifetime `'a` as defined on the function body at 15:10
30  --> $DIR/regions-free-region-ordering-caller.rs:15:10
31   |
32LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) {
33   |          ^^
34
35error[E0491]: in type `&'a &'b usize`, reference has a longer lifetime than the data it references
36  --> $DIR/regions-free-region-ordering-caller.rs:22:12
37   |
38LL |     let z: Option<&'a &'b usize> = None;
39   |            ^^^^^^^^^^^^^^^^^^^^^
40   |
41note: the pointer is valid for the lifetime `'a` as defined on the function body at 21:10
42  --> $DIR/regions-free-region-ordering-caller.rs:21:10
43   |
44LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) {
45   |          ^^
46note: but the referenced data is only valid for the lifetime `'b` as defined on the function body at 21:14
47  --> $DIR/regions-free-region-ordering-caller.rs:21:14
48   |
49LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) {
50   |              ^^
51
52error: aborting due to 3 previous errors
53
54For more information about this error, try `rustc --explain E0491`.