File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -20,5 +20,6 @@ fn main() {
2020 debug_dump_dict ( ) ;
2121 debug_dump_dict ( ) ;
2222 //~^ ERROR use of moved value: `debug_dump_dict`
23- //~| NOTE closure was moved because it only implements `FnOnce`
23+ //~| NOTE closure cannot be invoked more than once because it moves the
24+ //~| variable `dict` out of its environment
2425}
Original file line number Diff line number Diff line change 11error[E0382]: use of moved value: `debug_dump_dict`
22 --> $DIR/fn_once-moved.rs:21:5
33 |
4+ 16 | for (key, value) in dict {
5+ | ---- dict moved here
6+ ...
4720 | debug_dump_dict();
58 | --------------- value moved here
6921 | debug_dump_dict();
710 | ^^^^^^^^^^^^^^^ value used here after move
811 |
9- = help: closure was moved because it only implements `FnOnce`
12+ = help: closure cannot be invoked more than once because it moves the variable `dict` out of its environment
1013
1114error: aborting due to previous error
1215
You can’t perform that action at this time.
0 commit comments