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