]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
Auto merge of #67060 - Centril:rollup-hwhdx4h, r=Centril
[rust.git] / src / test / ui / nll / closure-requirements / propagate-approximated-shorter-to-static-no-bound.stderr
1 note: External requirements
2   --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:32:47
3    |
4 LL |       establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
5    |  _______________________________________________^
6 LL | |
7 LL | |
8 LL | |         // Only works if 'x: 'y:
9 LL | |         demand_y(x, y, x.get())
10 LL | |     });
11    | |_____^
12    |
13    = note: defining type: DefId(0:16 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [
14                i16,
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>)),
16            ]
17    = note: late-bound region is '_#2r
18    = note: late-bound region is '_#3r
19    = note: number of external vids: 4
20    = note: where '_#1r: '_#0r
21
22 note: No external requirements
23   --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:31:1
24    |
25 LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
26 LL | |     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
27 LL | |
28 LL | |
29 ...  |
30 LL | |     });
31 LL | | }
32    | |_^
33    |
34    = note: defining type: DefId(0:13 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]) with substs []
35
36 error[E0521]: borrowed data escapes outside of function
37   --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:32:5
38    |
39 LL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
40    |                     ------ `cell_a` is a reference that is only valid in the function body
41 LL | /     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
42 LL | |
43 LL | |
44 LL | |         // Only works if 'x: 'y:
45 LL | |         demand_y(x, y, x.get())
46 LL | |     });
47    | |______^ `cell_a` escapes the function body here
48    |
49    = help: consider replacing `'a` with `'static`
50
51 error: aborting due to previous error
52