fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1note: external requirements 2 --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:32:47 3 | 4LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { 5 | ^^^^^^^^^^^^^^^^^ 6 | 7 = note: defining type: supply::{closure#0} with closure args [ 8 i16, 9 for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) std::cell::Cell<&'?1 &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon }) u32>)), 10 (), 11 ] 12 = note: late-bound region is '?2 13 = note: late-bound region is '?3 14 = note: number of external vids: 4 15 = note: where '?1: '?0 16 17note: no external requirements 18 --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:31:1 19 | 20LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { 21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 22 | 23 = note: defining type: supply 24 25error[E0521]: borrowed data escapes outside of function 26 --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:32:5 27 | 28LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { 29 | -- ------ `cell_a` is a reference that is only valid in the function body 30 | | 31 | lifetime `'a` defined here 32LL | / establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { 33LL | | 34LL | | 35LL | | // Only works if 'x: 'y: 36LL | | demand_y(x, y, x.get()) 37LL | | }); 38 | | ^ 39 | | | 40 | |______`cell_a` escapes the function body here 41 | argument requires that `'a` must outlive `'static` 42 | 43 = note: requirement occurs because of the type `Cell<&'?9 u32>`, which makes the generic argument `&'?9 u32` invariant 44 = note: the struct `Cell<T>` is invariant over the parameter `T` 45 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance 46 47error: aborting due to previous error 48 49For more information about this error, try `rustc --explain E0521`.