summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-move-call-twice.rs
blob: f87be4a06f75f6178ce05c9d9e4e4a358387bcf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Test that we are able to infer a suitable kind for this closure
// that is just called (`FnMut`).

use std::mem;

fn main() {
    let mut counter: Vec<i32> = Vec::new();
    let tick = move || mem::drop(counter);
    tick();
    tick(); //~ ERROR use of moved value: `tick`
}