]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/once-cant-call-twice-on-heap.stderr
Use structured suggestion when requiring `Copy` constraint in type param
[rust.git] / src / test / ui / once-cant-call-twice-on-heap.stderr
index 40034dae5bcd31b13331103e023e274d4457600c..22f98c2a979b1e1cc538f71d1bd4b1ca4ae8675f 100644 (file)
@@ -1,12 +1,14 @@
 error[E0382]: use of moved value: `blk`
   --> $DIR/once-cant-call-twice-on-heap.rs:9:5
    |
+LL | fn foo<F:FnOnce()>(blk: F) {
+   |        --          --- move occurs because `blk` has type `F`, which does not implement the `Copy` trait
+   |        |
+   |        help: consider adding a `Copy` constraint to this type argument: `F: Copy +`
 LL |     blk();
    |     --- value moved here
 LL |     blk();
    |     ^^^ value used here after move
-   |
-   = note: move occurs because `blk` has type `F`, which does not implement the `Copy` trait
 
 error: aborting due to previous error