]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-missing-mut.rs
diagnostics: give a special note for unsafe fn / Fn/FnOnce/FnMut
[rust.git] / src / test / 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 }