1 error[E0759]: cannot infer an appropriate lifetime
2 --> $DIR/regions-proc-bound-capture.rs:9:14
4 LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + 'static> {
5 | ------ this data with an anonymous lifetime `'_`...
6 LL | // This is illegal, because the region bound on `proc` is 'static.
7 LL | Box::new(move || { *x })
8 | ^^^^^^^^^^^^^^ ...is captured here, requiring it to live as long as `'static`
10 help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
12 LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + '_> {
14 help: alternatively, add an explicit `'static` bound to this reference
16 LL | fn static_proc(x: &'static isize) -> Box<dyn FnMut() -> (isize) + 'static> {
19 error: aborting due to previous error
21 For more information about this error, try `rustc --explain E0759`.