diff options
Diffstat (limited to 'tests/ui/closure_context/issue-42065.rs')
-rw-r--r-- | tests/ui/closure_context/issue-42065.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/closure_context/issue-42065.rs b/tests/ui/closure_context/issue-42065.rs new file mode 100644 index 000000000..c506600f4 --- /dev/null +++ b/tests/ui/closure_context/issue-42065.rs @@ -0,0 +1,13 @@ +use std::collections::HashMap; + +fn main() { + let dict: HashMap<i32, i32> = HashMap::new(); + let debug_dump_dict = || { + for (key, value) in dict { + println!("{:?} - {:?}", key, value); + } + }; + debug_dump_dict(); + debug_dump_dict(); + //~^ ERROR use of moved value: `debug_dump_dict` +} |