summaryrefslogtreecommitdiffstats
path: root/tests/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs
blob: a98a01ca598a9ed328998133b0715beba41c6892 (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 = || mem::drop(counter);
    tick();
    tick(); //~ ERROR use of moved value: `tick`
}