]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-12127.rs
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-12127.rs
CommitLineData
f2b60f7d 1#![feature(unboxed_closures)]
223e47cc 2
85aaf69f 3fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f }
1a4d82fc 4fn do_it(x: &isize) { }
223e47cc
LB
5
6fn main() {
f2b60f7d 7 let x: Box<_> = Box::new(22);
85aaf69f
SL
8 let f = to_fn_once(move|| do_it(&*x));
9 to_fn_once(move|| {
1a4d82fc
JJ
10 f();
11 f();
12 //~^ ERROR: use of moved value: `f`
13 })()
223e47cc 14}