1 note: No external requirements
2 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:31:15
4 LL | foo(cell, |cell_a, cell_x| {
6 LL | | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
11 = note: defining type: DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]) with closure substs [
13 for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
16 error[E0521]: borrowed data escapes outside of closure
17 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:32:9
19 LL | foo(cell, |cell_a, cell_x| {
20 | ------ ------ `cell_x` is a reference that is only valid in the closure body
22 | `cell_a` is declared here, outside of the closure body
23 LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
24 | ^^^^^^^^^^^^^^^^^^^^^^^^ `cell_x` escapes the closure body here
26 note: No external requirements
27 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:28:1
31 LL | | let cell = Cell::new(&a);
32 LL | | foo(cell, |cell_a, cell_x| {
38 = note: defining type: DefId(0/0:5 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]) with substs []
40 note: External requirements
41 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:45:15
43 LL | foo(cell, |cell_a, cell_x| {
45 LL | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error
49 = note: defining type: DefId(0/1:13 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]::{{closure}}[0]) with closure substs [
51 for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
53 = note: number of external vids: 2
54 = note: where '_#1r: '_#0r
56 note: No external requirements
57 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:38:1
61 LL | | let cell = Cell::new(&a);
62 LL | | //~^ ERROR `a` does not live long enough
68 = note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]) with substs []
70 error[E0597]: `a` does not live long enough
71 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:40:26
73 LL | let cell = Cell::new(&a);
74 | ^^ borrowed value does not live long enough
77 | - `a` dropped here while still borrowed
79 = note: borrowed value must be valid for the static lifetime...
81 error: aborting due to 2 previous errors
83 Some errors occurred: E0521, E0597.
84 For more information about an error, try `rustc --explain E0521`.