]> git.lizzy.rs Git - rust.git/blob - tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-move.rs
Rollup merge of #106244 - atouchet:readme3, r=workingjubilee
[rust.git] / tests / ui / unboxed-closures / unboxed-closures-infer-fnmut-move.rs
1 // run-pass
2 // Test that we are able to infer a suitable kind for this `move`
3 // closure that is just called (`FnMut`).
4
5 fn main() {
6     let mut counter = 0;
7
8     let v = {
9         let mut tick = move || { counter += 1; counter };
10         tick();
11         tick()
12     };
13
14     assert_eq!(counter, 0);
15     assert_eq!(v, 2);
16 }