diff --git a/src/test/ui/fn_once-moved.rs b/src/test/ui/fn_once-moved.rs index 781d3885eae..409964082f2 100644 --- a/src/test/ui/fn_once-moved.rs +++ b/src/test/ui/fn_once-moved.rs @@ -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 } diff --git a/src/test/ui/fn_once-moved.stderr b/src/test/ui/fn_once-moved.stderr index 322ab64ebd4..dfee5931da7 100644 --- a/src/test/ui/fn_once-moved.stderr +++ b/src/test/ui/fn_once-moved.stderr @@ -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