summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-move-moved-value-into-closure.rs
blob: 72e7b5a716273a4afaab55700ac192c357955d52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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
}