about summary refs log tree commit diff
path: root/tests/ui/closures/fnonce-call-twice-error.stderr
blob: 51d8a33dcd79658d9879d2720a3b8cc238d1702e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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`.