mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
13 lines
200 B
Rust
13 lines
200 B
Rust
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
|
|
}
|