]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut.rs
Rollup merge of #86828 - lambinoo:67441-const-fn-copied-take-replace, r=joshtriplett
[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 }