]> git.proxmox.com Git - rustc.git/blame - src/test/ui/regions/regions-proc-bound-capture.rs
New upstream version 1.36.0+dfsg1
[rustc.git] / src / test / ui / regions / regions-proc-bound-capture.rs
CommitLineData
1a4d82fc
JJ
1fn 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`.
c34b1796 4 Box::new(move|| { *x })
1a4d82fc
JJ
5}
6
7fn static_proc(x: &isize) -> Box<FnMut()->(isize) + 'static> {
8 // This is illegal, because the region bound on `proc` is 'static.
2c00a5a8 9 Box::new(move|| { *x }) //~ ERROR explicit lifetime required in the type of `x` [E0621]
1a4d82fc
JJ
10}
11
12fn main() { }