@@ -3,7 +3,8 @@ note: External requirements
33 |
44LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
55 | _______________________________________________^
6- LL | | //~^ ERROR
6+ LL | | //~^ ERROR borrowed data escapes outside of function
7+ LL | | //~| ERROR unsatisfied lifetime constraints
78LL | | // Only works if 'x: 'y:
89LL | | demand_y(x, y, x.get())
910LL | | });
@@ -21,9 +22,9 @@ note: No external requirements
2122 |
2223LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
2324LL | | 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+ ... |
2728LL | | });
2829LL | | }
2930 | |_^
@@ -36,11 +37,22 @@ error: borrowed data escapes outside of function
3637LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
3738 | ------ `cell_a` is a reference that is only valid in the function body
3839LL | / 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
4042LL | | // Only works if 'x: 'y:
4143LL | | demand_y(x, y, x.get())
4244LL | | });
4345 | |______^ `cell_a` escapes the function body here
4446
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
4658
0 commit comments