summaryrefslogtreecommitdiffstats
path: root/tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.rs')
-rw-r--r--tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.rs b/tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.rs
new file mode 100644
index 000000000..144a674ac
--- /dev/null
+++ b/tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.rs
@@ -0,0 +1,8 @@
+// Test that we are able to infer a suitable kind for this closure
+// that is just called (`FnMut`).
+
+fn main() {
+ let mut counter = 0;
+ let tick = move || counter += 1;
+ tick(); //~ ERROR cannot borrow `tick` as mutable, as it is not declared as mutable
+}