]> git.proxmox.com Git - rustc.git/blame - src/test/ui/closures/closure-expected-type/expect-region-supply-region.polonius.stderr
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / closures / closure-expected-type / expect-region-supply-region.polonius.stderr
CommitLineData
60c5eb7d
XL
1error[E0521]: borrowed data escapes outside of closure
2 --> $DIR/expect-region-supply-region.rs:18:9
3 |
4LL | let mut f: Option<&u32> = None;
ba9703b0 5 | ----- `f` declared here, outside of the closure body
60c5eb7d
XL
6LL | closure_expecting_bound(|x| {
7 | - `x` is a reference that is only valid in the closure body
8LL | f = Some(x);
9 | ^^^^^^^^^^^ `x` escapes the closure body here
10
11error[E0521]: borrowed data escapes outside of closure
12 --> $DIR/expect-region-supply-region.rs:28:9
13 |
14LL | let mut f: Option<&u32> = None;
ba9703b0 15 | ----- `f` declared here, outside of the closure body
60c5eb7d
XL
16LL | closure_expecting_bound(|x: &u32| {
17 | - `x` is a reference that is only valid in the closure body
18LL | f = Some(x);
19 | ^^^^^^^^^^^ `x` escapes the closure body here
20
21error: lifetime may not live long enough
22 --> $DIR/expect-region-supply-region.rs:37:30
23 |
24LL | fn expect_bound_supply_named<'x>() {
25 | -- lifetime `'x` defined here
26...
27LL | closure_expecting_bound(|x: &'x u32| {
28 | ^ - let's call the lifetime of this reference `'1`
29 | |
30 | requires that `'1` must outlive `'x`
31
32error[E0521]: borrowed data escapes outside of closure
33 --> $DIR/expect-region-supply-region.rs:42:9
34 |
35LL | let mut f: Option<&u32> = None;
ba9703b0 36 | ----- `f` declared here, outside of the closure body
60c5eb7d
XL
37...
38LL | closure_expecting_bound(|x: &'x u32| {
39 | - `x` is a reference that is only valid in the closure body
40...
41LL | f = Some(x);
42 | ^^^^^^^^^^^ `x` escapes the closure body here
43
44error: lifetime may not live long enough
45 --> $DIR/expect-region-supply-region.rs:37:30
46 |
47LL | fn expect_bound_supply_named<'x>() {
48 | -- lifetime `'x` defined here
49...
50LL | closure_expecting_bound(|x: &'x u32| {
51 | ^ requires that `'x` must outlive `'static`
52 |
53 = help: consider replacing `'x` with `'static`
54
55error: aborting due to 5 previous errors
56