fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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