]> git.lizzy.rs Git - rust.git/blob - tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-missing-mut.rs
Rollup merge of #107171 - petrochenkov:encattrs, r=cjgillot
[rust.git] / tests / ui / unboxed-closures / unboxed-closures-infer-fnmut-missing-mut.rs
1 // Test that we are able to infer a suitable kind for this closure
2 // that is just called (`FnMut`).
3
4 fn main() {
5     let mut counter = 0;
6     let tick = || counter += 1;
7     tick(); //~ ERROR cannot borrow `tick` as mutable, as it is not declared as mutable
8 }