diff options
Diffstat (limited to 'tests/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs')
-rw-r--r-- | tests/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs b/tests/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs new file mode 100644 index 000000000..a98a01ca5 --- /dev/null +++ b/tests/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` +} |