summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs')
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs
new file mode 100644
index 000000000..a98a01ca5
--- /dev/null
+++ b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs
@@ -0,0 +1,11 @@
+// Test that we are able to infer a suitable kind for this closure
+// that is just called (`FnMut`).
+
+use std::mem;
+
+fn main() {
+ let mut counter: Vec<i32> = Vec::new();
+ let tick = || mem::drop(counter);
+ tick();
+ tick(); //~ ERROR use of moved value: `tick`
+}