]>
Commit | Line | Data |
---|---|---|
8faf50e0 XL |
1 | error: borrowed data escapes outside of closure |
2 | --> $DIR/expect-region-supply-region.rs:28:9 | |
83c7162d | 3 | | |
8faf50e0 XL |
4 | LL | let mut f: Option<&u32> = None; |
5 | | ----- `f` is declared here, outside of the closure body | |
6 | LL | closure_expecting_bound(|x| { | |
7 | | - `x` is a reference that is only valid in the closure body | |
83c7162d | 8 | LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure |
8faf50e0 | 9 | | ^^^^^^^^^^^ `x` escapes the closure body here |
83c7162d | 10 | |
8faf50e0 XL |
11 | error: borrowed data escapes outside of closure |
12 | --> $DIR/expect-region-supply-region.rs:38:9 | |
83c7162d | 13 | | |
8faf50e0 XL |
14 | LL | let mut f: Option<&u32> = None; |
15 | | ----- `f` is declared here, outside of the closure body | |
16 | LL | closure_expecting_bound(|x: &u32| { | |
17 | | - `x` is a reference that is only valid in the closure body | |
83c7162d | 18 | LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure |
8faf50e0 | 19 | | ^^^^^^^^^^^ `x` escapes the closure body here |
83c7162d | 20 | |
8faf50e0 XL |
21 | error: borrowed data escapes outside of closure |
22 | --> $DIR/expect-region-supply-region.rs:52:9 | |
83c7162d | 23 | | |
8faf50e0 XL |
24 | LL | let mut f: Option<&u32> = None; |
25 | | ----- `f` is declared here, outside of the closure body | |
26 | ... | |
27 | LL | closure_expecting_bound(|x: &'x u32| { | |
28 | | - `x` is a reference that is only valid in the closure body | |
29 | ... | |
83c7162d | 30 | LL | f = Some(x); |
8faf50e0 | 31 | | ^^^^^^^^^^^ `x` escapes the closure body here |
83c7162d XL |
32 | |
33 | error: aborting due to 3 previous errors | |
34 |