1 error: borrowed data cannot be stored outside of its closure
2 --> $DIR/expect-region-supply-region.rs:28:18
4 26 | let mut f: Option<&u32> = None;
5 | ----- borrowed data cannot be stored into here...
6 27 | closure_expecting_bound(|x| {
7 | --- ...because it cannot outlive this closure
8 28 | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
9 | ^ cannot be stored outside of its closure
11 error: borrowed data cannot be stored outside of its closure
12 --> $DIR/expect-region-supply-region.rs:38:18
14 36 | let mut f: Option<&u32> = None;
15 | ----- borrowed data cannot be stored into here...
16 37 | closure_expecting_bound(|x: &u32| {
17 | --------- ...because it cannot outlive this closure
18 38 | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
19 | ^ cannot be stored outside of its closure
21 error[E0308]: mismatched types
22 --> $DIR/expect-region-supply-region.rs:47:33
24 47 | closure_expecting_bound(|x: &'x u32| {
25 | ^^^^^^^ lifetime mismatch
27 = note: expected type `&u32`
29 note: the anonymous lifetime #2 defined on the body at 47:29...
30 --> $DIR/expect-region-supply-region.rs:47:29
32 47 | closure_expecting_bound(|x: &'x u32| {
33 | _____________________________^
34 48 | | //~^ ERROR mismatched types
35 49 | | //~| ERROR mismatched types
38 53 | | //~^ ERROR borrowed data cannot be stored outside of its closure
41 note: ...does not necessarily outlive the lifetime 'x as defined on the function body at 42:1
42 --> $DIR/expect-region-supply-region.rs:42:1
44 42 | fn expect_bound_supply_named<'x>() {
45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47 error[E0308]: mismatched types
48 --> $DIR/expect-region-supply-region.rs:47:33
50 47 | closure_expecting_bound(|x: &'x u32| {
51 | ^^^^^^^ lifetime mismatch
53 = note: expected type `&u32`
55 note: the lifetime 'x as defined on the function body at 42:1...
56 --> $DIR/expect-region-supply-region.rs:42:1
58 42 | fn expect_bound_supply_named<'x>() {
59 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60 note: ...does not necessarily outlive the anonymous lifetime #2 defined on the body at 47:29
61 --> $DIR/expect-region-supply-region.rs:47:29
63 47 | closure_expecting_bound(|x: &'x u32| {
64 | _____________________________^
65 48 | | //~^ ERROR mismatched types
66 49 | | //~| ERROR mismatched types
69 53 | | //~^ ERROR borrowed data cannot be stored outside of its closure
73 error: borrowed data cannot be stored outside of its closure
74 --> $DIR/expect-region-supply-region.rs:52:18
76 43 | let mut f: Option<&u32> = None;
77 | ----- borrowed data cannot be stored into here...
79 47 | closure_expecting_bound(|x: &'x u32| {
80 | ------------ ...because it cannot outlive this closure
83 | ^ cannot be stored outside of its closure
85 error: aborting due to 5 previous errors