Update fn_once-moved test

This commit is contained in:
Tommy Ip 2017-05-30 10:47:51 +01:00
parent ee88a870b6
commit 31bfdd7f17
2 changed files with 6 additions and 2 deletions

View File

@ -20,5 +20,6 @@ fn main() {
debug_dump_dict();
debug_dump_dict();
//~^ ERROR use of moved value: `debug_dump_dict`
//~| NOTE closure was moved because it only implements `FnOnce`
//~| NOTE closure cannot be invoked more than once because it moves the
//~| variable `dict` out of its environment
}

View File

@ -1,12 +1,15 @@
error[E0382]: use of moved value: `debug_dump_dict`
--> $DIR/fn_once-moved.rs:21:5
|
16 | for (key, value) in dict {
| ---- dict moved here
...
20 | debug_dump_dict();
| --------------- value moved here
21 | debug_dump_dict();
| ^^^^^^^^^^^^^^^ value used here after move
|
= help: closure was moved because it only implements `FnOnce`
= help: closure cannot be invoked more than once because it moves the variable `dict` out of its environment
error: aborting due to previous error