]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-12127.rs
Auto merge of #106827 - alexcrichton:update-llvm-to-15.0.7, r=cuviper
[rust.git] / tests / ui / issues / issue-12127.rs
1 #![feature(unboxed_closures, tuple_trait)]
2
3 fn to_fn_once<A:std::marker::Tuple,F:FnOnce<A>>(f: F) -> F { f }
4 fn do_it(x: &isize) { }
5
6 fn main() {
7     let x: Box<_> = Box::new(22);
8     let f = to_fn_once(move|| do_it(&*x));
9     to_fn_once(move|| {
10         f();
11         f();
12         //~^ ERROR: use of moved value: `f`
13     })()
14 }