fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error: lifetime may not live long enough 2 --> $DIR/regions-proc-bound-capture.rs:9:5 3 | 4LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + 'static> { 5 | - let's call the lifetime of this reference `'1` 6LL | // This is illegal, because the region bound on `proc` is 'static. 7LL | Box::new(move || { *x }) 8 | ^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static` 9 | 10help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x` 11 | 12LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + '_> { 13 | ~~ 14help: alternatively, add an explicit `'static` bound to this reference 15 | 16LL | fn static_proc(x: &'static isize) -> Box<dyn FnMut() -> (isize) + 'static> { 17 | ~~~~~~~~~~~~~~ 18 19error: aborting due to previous error 20