2020-01-10 08:13:05 -06:00
|
|
|
note: no external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:21:15
|
2017-12-07 04:20:12 -06:00
|
|
|
|
|
2022-08-31 13:17:32 -05:00
|
|
|
LL | foo(cell, |cell_a, cell_x| {
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
2017-12-07 04:20:12 -06:00
|
|
|
|
|
2020-08-31 12:11:44 -05:00
|
|
|
= note: defining type: case1::{closure#0} with closure substs [
|
2017-12-07 04:20:12 -06:00
|
|
|
i32,
|
2022-11-11 06:10:53 -06:00
|
|
|
for<Region(BrAnon(0, None))> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>)),
|
2020-03-12 20:23:38 -05:00
|
|
|
(),
|
2017-12-07 04:20:12 -06:00
|
|
|
]
|
|
|
|
|
2018-10-14 08:53:10 -05:00
|
|
|
error[E0521]: borrowed data escapes outside of closure
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:22:9
|
2018-07-31 07:35:43 -05:00
|
|
|
|
|
|
|
|
LL | foo(cell, |cell_a, cell_x| {
|
|
|
|
| ------ ------ `cell_x` is a reference that is only valid in the closure body
|
|
|
|
| |
|
2020-01-21 19:41:44 -06:00
|
|
|
| `cell_a` declared here, outside of the closure body
|
2018-07-31 07:35:43 -05:00
|
|
|
LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ `cell_x` escapes the closure body here
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: no external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:18:1
|
2017-12-07 04:20:12 -06:00
|
|
|
|
|
2022-08-31 13:17:32 -05:00
|
|
|
LL | fn case1() {
|
|
|
|
| ^^^^^^^^^^
|
2017-12-07 04:20:12 -06:00
|
|
|
|
|
2019-11-30 10:47:21 -06:00
|
|
|
= note: defining type: case1
|
2017-12-07 04:20:12 -06:00
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:35:15
|
2017-12-07 04:20:12 -06:00
|
|
|
|
|
2022-08-31 13:17:32 -05:00
|
|
|
LL | foo(cell, |cell_a, cell_x| {
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
2017-12-07 04:20:12 -06:00
|
|
|
|
|
2020-08-31 12:11:44 -05:00
|
|
|
= note: defining type: case2::{closure#0} with closure substs [
|
2017-12-07 04:20:12 -06:00
|
|
|
i32,
|
2022-11-11 06:10:53 -06:00
|
|
|
for<Region(BrAnon(0, None))> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>)),
|
2020-03-12 20:23:38 -05:00
|
|
|
(),
|
2017-12-07 04:20:12 -06:00
|
|
|
]
|
|
|
|
= note: number of external vids: 2
|
|
|
|
= note: where '_#1r: '_#0r
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: no external requirements
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:28:1
|
2017-12-07 04:20:12 -06:00
|
|
|
|
|
2022-08-31 13:17:32 -05:00
|
|
|
LL | fn case2() {
|
|
|
|
| ^^^^^^^^^^
|
2017-12-07 04:20:12 -06:00
|
|
|
|
|
2019-11-30 10:47:21 -06:00
|
|
|
= note: defining type: case2
|
2017-12-07 04:20:12 -06:00
|
|
|
|
2017-12-07 05:25:59 -06:00
|
|
|
error[E0597]: `a` does not live long enough
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:30:26
|
2017-12-07 05:25:59 -06:00
|
|
|
|
|
2022-10-27 11:15:11 -05:00
|
|
|
LL | let cell = Cell::new(&a);
|
|
|
|
| ^^ borrowed value does not live long enough
|
2017-12-07 05:25:59 -06:00
|
|
|
...
|
2022-10-27 11:15:11 -05:00
|
|
|
LL | / foo(cell, |cell_a, cell_x| {
|
|
|
|
LL | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error
|
|
|
|
LL | | })
|
|
|
|
| |______- argument requires that `a` is borrowed for `'static`
|
|
|
|
LL | }
|
|
|
|
| - `a` dropped here while still borrowed
|
2017-12-07 05:25:59 -06:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
2017-12-07 04:20:12 -06:00
|
|
|
|
2021-02-01 11:23:12 -06:00
|
|
|
Some errors have detailed explanations: E0521, E0597.
|
|
|
|
For more information about an error, try `rustc --explain E0521`.
|