]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-proc-bound-capture.rs
Rollup merge of #59880 - solson:transmute-float, r=alexcrichton
[rust.git] / src / test / ui / regions / regions-proc-bound-capture.rs
1 fn borrowed_proc<'a>(x: &'a isize) -> Box<FnMut()->(isize) + 'a> {
2     // This is legal, because the region bound on `proc`
3     // states that it captures `x`.
4     Box::new(move|| { *x })
5 }
6
7 fn static_proc(x: &isize) -> Box<FnMut()->(isize) + 'static> {
8     // This is illegal, because the region bound on `proc` is 'static.
9     Box::new(move|| { *x }) //~ ERROR explicit lifetime required in the type of `x` [E0621]
10 }
11
12 fn main() { }