@@ -3,7 +3,8 @@ note: External requirements
3
3
|
4
4
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
5
5
| _______________________________________________^
6
- LL | | //~^ ERROR
6
+ LL | | //~^ ERROR borrowed data escapes outside of function
7
+ LL | | //~| ERROR unsatisfied lifetime constraints
7
8
LL | | // Only works if 'x: 'y:
8
9
LL | | demand_y(x, y, x.get())
9
10
LL | | });
@@ -21,9 +22,9 @@ note: No external requirements
21
22
|
22
23
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
23
24
LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
24
- LL | | //~^ ERROR
25
- LL | | // Only works if 'x: 'y:
26
- LL | | demand_y(x, y, x.get())
25
+ LL | | //~^ ERROR borrowed data escapes outside of function
26
+ LL | | //~| ERROR unsatisfied lifetime constraints
27
+ ... |
27
28
LL | | });
28
29
LL | | }
29
30
| |_^
@@ -36,11 +37,22 @@ error: borrowed data escapes outside of function
36
37
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
37
38
| ------ `cell_a` is a reference that is only valid in the function body
38
39
LL | / establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
39
- LL | | //~^ ERROR
40
+ LL | | //~^ ERROR borrowed data escapes outside of function
41
+ LL | | //~| ERROR unsatisfied lifetime constraints
40
42
LL | | // Only works if 'x: 'y:
41
43
LL | | demand_y(x, y, x.get())
42
44
LL | | });
43
45
| |______^ `cell_a` escapes the function body here
44
46
45
- error: aborting due to previous error
47
+ error: unsatisfied lifetime constraints
48
+ --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:29
49
+ |
50
+ LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
51
+ | -- -- lifetime `'b` defined here
52
+ | |
53
+ | lifetime `'a` defined here
54
+ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
55
+ | ^^^^^^^ requires that `'a` must outlive `'b`
56
+
57
+ error: aborting due to 2 previous errors
46
58
0 commit comments