]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / nll / closure-requirements / propagate-approximated-shorter-to-static-no-bound.stderr
CommitLineData
dfeec247 1note: external requirements
0731742a 2 --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:32:47
ff7c6d11 3 |
0531ce1d 4LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
ff7c6d11 5 | _______________________________________________^
532ac7d7 6LL | |
0531ce1d
XL
7LL | |
8LL | | // Only works if 'x: 'y:
b7449926 9LL | | demand_y(x, y, x.get())
0531ce1d 10LL | | });
ff7c6d11
XL
11 | |_____^
12 |
60c5eb7d 13 = note: defining type: supply::{{closure}}#0 with closure substs [
ff7c6d11 14 i16,
60c5eb7d 15 for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t1)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t2)) u32>)),
ba9703b0 16 (),
ff7c6d11 17 ]
b7449926
XL
18 = note: late-bound region is '_#2r
19 = note: late-bound region is '_#3r
8faf50e0 20 = note: number of external vids: 4
ff7c6d11
XL
21 = note: where '_#1r: '_#0r
22
dfeec247 23note: no external requirements
0731742a 24 --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:31:1
b7449926
XL
25 |
26LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
27LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
532ac7d7 28LL | |
0bf4aa26 29LL | |
b7449926
XL
30... |
31LL | | });
32LL | | }
33 | |_^
34 |
60c5eb7d 35 = note: defining type: supply
b7449926 36
0bf4aa26 37error[E0521]: borrowed data escapes outside of function
0731742a 38 --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:32:5
ff7c6d11 39 |
8faf50e0
XL
40LL | 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
94b46f34 42LL | / establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
532ac7d7 43LL | |
0531ce1d
XL
44LL | |
45LL | | // Only works if 'x: 'y:
b7449926 46LL | | demand_y(x, y, x.get())
0531ce1d 47LL | | });
8faf50e0 48 | |______^ `cell_a` escapes the function body here
60c5eb7d
XL
49 |
50 = help: consider replacing `'a` with `'static`
ff7c6d11 51
0bf4aa26 52error: aborting due to previous error
ff7c6d11 53