rust/tests/ui/closure_context/issue-42065.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
327 B
Rust
Raw Normal View History

2017-05-05 16:28:36 -05:00
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`
}