1 note: External requirements
2 --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:47
4 LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
5 | _______________________________________________^
6 LL | | //~^ ERROR borrowed data escapes outside of function
8 LL | | // Only works if 'x: 'y:
9 LL | | demand_y(x, y, x.get())
10 LL | | //~^ ERROR unsatisfied lifetime constraints
14 = note: defining type: DefId(0/1:18 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [
16 for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) u32>))
18 = note: late-bound region is '_#2r
19 = note: late-bound region is '_#3r
20 = note: number of external vids: 4
21 = note: where '_#1r: '_#0r
23 note: No external requirements
24 --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:44:1
26 LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
27 LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
28 LL | | //~^ ERROR borrowed data escapes outside of function
35 = note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]) with substs []
37 error[E0521]: borrowed data escapes outside of function
38 --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:5
40 LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
41 | ------ `cell_a` is a reference that is only valid in the function body
42 LL | / establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
43 LL | | //~^ ERROR borrowed data escapes outside of function
45 LL | | // Only works if 'x: 'y:
46 LL | | demand_y(x, y, x.get())
47 LL | | //~^ ERROR unsatisfied lifetime constraints
49 | |______^ `cell_a` escapes the function body here
51 error: unsatisfied lifetime constraints
52 --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:49:9
54 LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
55 | -- -- lifetime `'b` defined here
57 | lifetime `'a` defined here
59 LL | demand_y(x, y, x.get())
60 | ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'a` must outlive `'b`
62 error: aborting due to 2 previous errors
64 For more information about this error, try `rustc --explain E0521`.