rust/tests/ui/borrowck/borrowck-move-moved-value-into-closure.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
200 B
Rust
Raw Normal View History

fn call_f<F:FnOnce() -> isize>(f: F) -> isize {
f()
}
fn main() {
let t: Box<_> = Box::new(3);
call_f(move|| { *t + 1 });
call_f(move|| { *t + 1 }); //~ ERROR use of moved value
}