blob: 51d8a33dcd79658d9879d2720a3b8cc238d1702e [file] [log] [blame]
error[E0382]: use of moved value: `blk`
--> $DIR/fnonce-call-twice-error.rs:7:5
|
LL | fn foo<F: FnOnce()>(blk: F) {
| --- move occurs because `blk` has type `F`, which does not implement the `Copy` trait
LL | blk();
| ----- `blk` moved due to this call
LL | blk();
| ^^^ value used here after move
|
note: `FnOnce` closures can only be called once
--> $DIR/fnonce-call-twice-error.rs:5:11
|
LL | fn foo<F: FnOnce()>(blk: F) {
| ^^^^^^^^ `F` is made to be an `FnOnce` closure here
LL | blk();
| ----- this value implements `FnOnce`, which causes it to be moved when called
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0382`.