]> git.proxmox.com Git - rustc.git/blame - src/test/ui/closures/closure-expected-type/expect-region-supply-region.nll.stderr
New upstream version 1.30.0+dfsg1
[rustc.git] / src / test / ui / closures / closure-expected-type / expect-region-supply-region.nll.stderr
CommitLineData
8faf50e0
XL
1error: borrowed data escapes outside of closure
2 --> $DIR/expect-region-supply-region.rs:28:9
83c7162d 3 |
8faf50e0
XL
4LL | let mut f: Option<&u32> = None;
5 | ----- `f` is declared here, outside of the closure body
6LL | closure_expecting_bound(|x| {
7 | - `x` is a reference that is only valid in the closure body
83c7162d 8LL | 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
11error: borrowed data escapes outside of closure
12 --> $DIR/expect-region-supply-region.rs:38:9
83c7162d 13 |
8faf50e0
XL
14LL | let mut f: Option<&u32> = None;
15 | ----- `f` is declared here, outside of the closure body
16LL | closure_expecting_bound(|x: &u32| {
17 | - `x` is a reference that is only valid in the closure body
83c7162d 18LL | 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
21error: borrowed data escapes outside of closure
22 --> $DIR/expect-region-supply-region.rs:52:9
83c7162d 23 |
8faf50e0
XL
24LL | let mut f: Option<&u32> = None;
25 | ----- `f` is declared here, outside of the closure body
26...
27LL | closure_expecting_bound(|x: &'x u32| {
28 | - `x` is a reference that is only valid in the closure body
29...
83c7162d 30LL | f = Some(x);
8faf50e0 31 | ^^^^^^^^^^^ `x` escapes the closure body here
83c7162d
XL
32
33error: aborting due to 3 previous errors
34