1 note: no external requirements
2 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:21: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: case1::{closure#0} with closure substs [
13 for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>)),
17 error[E0521]: borrowed data escapes outside of closure
18 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:22:9
20 LL | foo(cell, |cell_a, cell_x| {
21 | ------ ------ `cell_x` is a reference that is only valid in the closure body
23 | `cell_a` declared here, outside of the closure body
24 LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
25 | ^^^^^^^^^^^^^^^^^^^^^^^^ `cell_x` escapes the closure body here
27 note: no external requirements
28 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:18:1
32 LL | | let cell = Cell::new(&a);
33 LL | | foo(cell, |cell_a, cell_x| {
39 = note: defining type: case1
41 note: external requirements
42 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:35:15
44 LL | foo(cell, |cell_a, cell_x| {
46 LL | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error
50 = note: defining type: case2::{closure#0} with closure substs [
52 for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>)),
55 = note: number of external vids: 2
56 = note: where '_#1r: '_#0r
58 note: no external requirements
59 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:28:1
63 LL | | let cell = Cell::new(&a);
70 = note: defining type: case2
72 error[E0597]: `a` does not live long enough
73 --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:30:26
75 LL | let cell = Cell::new(&a);
76 | ^^ borrowed value does not live long enough
78 LL | / foo(cell, |cell_a, cell_x| {
79 LL | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error
81 | |______- argument requires that `a` is borrowed for `'static`
83 | - `a` dropped here while still borrowed
85 error: aborting due to 2 previous errors
87 Some errors have detailed explanations: E0521, E0597.
88 For more information about an error, try `rustc --explain E0521`.