1 error[E0521]: borrowed data escapes outside of closure
2 --> $DIR/expect-region-supply-region.rs:18:9
4 LL | let mut f: Option<&u32> = None;
5 | ----- `f` 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
9 | ^^^^^^^^^^^ `x` escapes the closure body here
11 error[E0521]: borrowed data escapes outside of closure
12 --> $DIR/expect-region-supply-region.rs:28:9
14 LL | let mut f: Option<&u32> = None;
15 | ----- `f` 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
19 | ^^^^^^^^^^^ `x` escapes the closure body here
21 error: lifetime may not live long enough
22 --> $DIR/expect-region-supply-region.rs:37:30
24 LL | fn expect_bound_supply_named<'x>() {
25 | -- lifetime `'x` defined here
27 LL | closure_expecting_bound(|x: &'x u32| {
28 | ^ - let's call the lifetime of this reference `'1`
30 | requires that `'1` must outlive `'x`
32 error: lifetime may not live long enough
33 --> $DIR/expect-region-supply-region.rs:37:30
35 LL | fn expect_bound_supply_named<'x>() {
36 | -- lifetime `'x` defined here
38 LL | closure_expecting_bound(|x: &'x u32| {
39 | ^ requires that `'x` must outlive `'static`
41 = help: consider replacing `'x` with `'static`
43 error: aborting due to 4 previous errors