fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1.3 KiB33 linesraw
1error: lifetime may not live long enough
2  --> $DIR/regions-free-region-ordering-caller.rs:11:12
3   |
4LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) {
5   |          --  -- lifetime `'b` defined here
6   |          |
7   |          lifetime `'a` defined here
8LL |     let z: Option<&'b &'a usize> = None;
9   |            ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b`
10
11error: lifetime may not live long enough
12  --> $DIR/regions-free-region-ordering-caller.rs:17:12
13   |
14LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) {
15   |          --  -- lifetime `'b` defined here
16   |          |
17   |          lifetime `'a` defined here
18LL |     let y: Paramd<'a> = Paramd { x: a };
19LL |     let z: Option<&'b Paramd<'a>> = None;
20   |            ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b`
21
22error: lifetime may not live long enough
23  --> $DIR/regions-free-region-ordering-caller.rs:22:12
24   |
25LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) {
26   |          --  -- lifetime `'b` defined here
27   |          |
28   |          lifetime `'a` defined here
29LL |     let z: Option<&'a &'b usize> = None;
30   |            ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
31
32error: aborting due to 3 previous errors
33