]> git.lizzy.rs Git - rust.git/blob - tests/ui/once-cant-call-twice-on-heap.stderr
Auto merge of #105716 - chriswailes:ndk-update-redux, r=pietroalbini
[rust.git] / tests / ui / once-cant-call-twice-on-heap.stderr
1 error[E0382]: use of moved value: `blk`
2   --> $DIR/once-cant-call-twice-on-heap.rs:8:5
3    |
4 LL | fn foo<F:FnOnce()>(blk: F) {
5    |                    --- move occurs because `blk` has type `F`, which does not implement the `Copy` trait
6 LL |     blk();
7    |     ----- `blk` moved due to this call
8 LL |     blk();
9    |     ^^^ value used here after move
10    |
11 note: this value implements `FnOnce`, which causes it to be moved when called
12   --> $DIR/once-cant-call-twice-on-heap.rs:7:5
13    |
14 LL |     blk();
15    |     ^^^
16 help: consider further restricting this bound
17    |
18 LL | fn foo<F:FnOnce() + Copy>(blk: F) {
19    |                   ++++++
20
21 error: aborting due to previous error
22
23 For more information about this error, try `rustc --explain E0382`.