]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/binop/binop-move-semantics.stderr
Use structured suggestion when requiring `Copy` constraint in type param
[rust.git] / src / test / ui / binop / binop-move-semantics.stderr
index 897607dc2d8d52b59457c21d528386af02670093..8efb73657fa81978f9628046171b1dfd96a93e2d 100644 (file)
@@ -2,9 +2,9 @@ error[E0382]: use of moved value: `x`
   --> $DIR/binop-move-semantics.rs:8:5
    |
 LL | fn double_move<T: Add<Output=()>>(x: T) {
-   |                -                  - move occurs because `x` has type `T`, which does not implement the `Copy` trait
+   |                --                 - move occurs because `x` has type `T`, which does not implement the `Copy` trait
    |                |
-   |                consider adding a `Copy` constraint to this type argument
+   |                help: consider adding a `Copy` constraint to this type argument: `T: Copy +`
 LL |     x
    |     - value moved here
 LL |     +
@@ -15,9 +15,9 @@ error[E0382]: borrow of moved value: `x`
   --> $DIR/binop-move-semantics.rs:14:5
    |
 LL | fn move_then_borrow<T: Add<Output=()> + Clone>(x: T) {
-   |                     -                          - move occurs because `x` has type `T`, which does not implement the `Copy` trait
+   |                     --                         - move occurs because `x` has type `T`, which does not implement the `Copy` trait
    |                     |
-   |                     consider adding a `Copy` constraint to this type argument
+   |                     help: consider adding a `Copy` constraint to this type argument: `T: Copy +`
 LL |     x
    |     - value moved here
 LL |     +