2018-08-08 12:28:26 +00:00
|
|
|
error[E0382]: use of moved value: `lhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:7:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs + rhs;
|
2020-06-11 17:48:46 +00:00
|
|
|
| --------- `lhs` moved due to usage in operator
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `A` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:5:8
|
|
|
|
|
|
|
|
|
LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs + rhs;
|
|
|
|
| --- you could clone this value
|
2020-06-11 17:48:46 +00:00
|
|
|
note: calling this operator moves the left-hand side
|
2022-12-12 15:36:08 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider further restricting this bound
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn add<A: Add<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `rhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:8:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs + rhs;
|
|
|
|
| --- value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
|
|
|
LL | drop(rhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `B` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:5:30
|
|
|
|
|
|
|
|
|
LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs + rhs;
|
|
|
|
| --- you could clone this value
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `B`
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn add<A: Add<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `lhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:13:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs - rhs;
|
2020-06-11 17:48:46 +00:00
|
|
|
| --------- `lhs` moved due to usage in operator
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `A` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:11:8
|
|
|
|
|
|
|
|
|
LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs - rhs;
|
|
|
|
| --- you could clone this value
|
2020-06-11 17:48:46 +00:00
|
|
|
note: calling this operator moves the left-hand side
|
2022-12-12 15:36:08 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider further restricting this bound
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn sub<A: Sub<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `rhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:14:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs - rhs;
|
|
|
|
| --- value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
|
|
|
LL | drop(rhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `B` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:11:30
|
|
|
|
|
|
|
|
|
LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs - rhs;
|
|
|
|
| --- you could clone this value
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `B`
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn sub<A: Sub<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `lhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:19:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs * rhs;
|
2020-06-11 17:48:46 +00:00
|
|
|
| --------- `lhs` moved due to usage in operator
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `A` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:17:8
|
|
|
|
|
|
|
|
|
LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs * rhs;
|
|
|
|
| --- you could clone this value
|
2020-06-11 17:48:46 +00:00
|
|
|
note: calling this operator moves the left-hand side
|
2022-12-12 15:36:08 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider further restricting this bound
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn mul<A: Mul<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `rhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:20:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs * rhs;
|
|
|
|
| --- value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
|
|
|
LL | drop(rhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `B` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:17:30
|
|
|
|
|
|
|
|
|
LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs * rhs;
|
|
|
|
| --- you could clone this value
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `B`
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn mul<A: Mul<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `lhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:25:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs / rhs;
|
2020-06-11 17:48:46 +00:00
|
|
|
| --------- `lhs` moved due to usage in operator
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `A` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:23:8
|
|
|
|
|
|
|
|
|
LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs / rhs;
|
|
|
|
| --- you could clone this value
|
2020-06-11 17:48:46 +00:00
|
|
|
note: calling this operator moves the left-hand side
|
2022-12-12 15:36:08 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider further restricting this bound
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn div<A: Div<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `rhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:26:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs / rhs;
|
|
|
|
| --- value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
|
|
|
LL | drop(rhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `B` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:23:30
|
|
|
|
|
|
|
|
|
LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs / rhs;
|
|
|
|
| --- you could clone this value
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `B`
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn div<A: Div<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `lhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:31:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs % rhs;
|
2020-06-11 17:48:46 +00:00
|
|
|
| --------- `lhs` moved due to usage in operator
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `A` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:29:8
|
|
|
|
|
|
|
|
|
LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs % rhs;
|
|
|
|
| --- you could clone this value
|
2020-06-11 17:48:46 +00:00
|
|
|
note: calling this operator moves the left-hand side
|
2022-12-12 15:36:08 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider further restricting this bound
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn rem<A: Rem<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `rhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:32:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs % rhs;
|
|
|
|
| --- value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
|
|
|
LL | drop(rhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `B` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:29:30
|
|
|
|
|
|
|
|
|
LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs % rhs;
|
|
|
|
| --- you could clone this value
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `B`
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn rem<A: Rem<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `lhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:37:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs & rhs;
|
2020-06-11 17:48:46 +00:00
|
|
|
| --------- `lhs` moved due to usage in operator
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `A` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:35:11
|
|
|
|
|
|
|
|
|
LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs & rhs;
|
|
|
|
| --- you could clone this value
|
2020-06-11 17:48:46 +00:00
|
|
|
note: calling this operator moves the left-hand side
|
2022-12-12 15:36:08 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider further restricting this bound
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn bitand<A: BitAnd<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `rhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:38:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs & rhs;
|
|
|
|
| --- value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
|
|
|
LL | drop(rhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `B` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:35:36
|
|
|
|
|
|
|
|
|
LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs & rhs;
|
|
|
|
| --- you could clone this value
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `B`
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn bitand<A: BitAnd<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `lhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:43:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs | rhs;
|
2020-06-11 17:48:46 +00:00
|
|
|
| --------- `lhs` moved due to usage in operator
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `A` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:41:10
|
|
|
|
|
|
|
|
|
LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs | rhs;
|
|
|
|
| --- you could clone this value
|
2020-06-11 17:48:46 +00:00
|
|
|
note: calling this operator moves the left-hand side
|
2022-12-12 15:36:08 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider further restricting this bound
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn bitor<A: BitOr<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `rhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:44:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs | rhs;
|
|
|
|
| --- value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
|
|
|
LL | drop(rhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `B` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:41:34
|
|
|
|
|
|
|
|
|
LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs | rhs;
|
|
|
|
| --- you could clone this value
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `B`
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn bitor<A: BitOr<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `lhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:49:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs ^ rhs;
|
2020-06-11 17:48:46 +00:00
|
|
|
| --------- `lhs` moved due to usage in operator
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `A` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:47:11
|
|
|
|
|
|
|
|
|
LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs ^ rhs;
|
|
|
|
| --- you could clone this value
|
2020-06-11 17:48:46 +00:00
|
|
|
note: calling this operator moves the left-hand side
|
2022-12-12 15:36:08 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider further restricting this bound
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn bitxor<A: BitXor<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `rhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:50:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs ^ rhs;
|
|
|
|
| --- value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
|
|
|
LL | drop(rhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `B` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:47:36
|
|
|
|
|
|
|
|
|
LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs ^ rhs;
|
|
|
|
| --- you could clone this value
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `B`
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn bitxor<A: BitXor<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `lhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:55:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs << rhs;
|
2020-06-11 17:48:46 +00:00
|
|
|
| ---------- `lhs` moved due to usage in operator
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `A` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:53:8
|
|
|
|
|
|
|
|
|
LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs << rhs;
|
|
|
|
| --- you could clone this value
|
2020-06-11 17:48:46 +00:00
|
|
|
note: calling this operator moves the left-hand side
|
2022-12-12 15:36:08 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider further restricting this bound
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn shl<A: Shl<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `rhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:56:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs << rhs;
|
|
|
|
| --- value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
|
|
|
LL | drop(rhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `B` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:53:30
|
|
|
|
|
|
|
|
|
LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs << rhs;
|
|
|
|
| --- you could clone this value
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `B`
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn shl<A: Shl<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `lhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:61:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs >> rhs;
|
2020-06-11 17:48:46 +00:00
|
|
|
| ---------- `lhs` moved due to usage in operator
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `A` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:59:8
|
|
|
|
|
|
|
|
|
LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs >> rhs;
|
|
|
|
| --- you could clone this value
|
2020-06-11 17:48:46 +00:00
|
|
|
note: calling this operator moves the left-hand side
|
2022-12-12 15:36:08 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider further restricting this bound
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn shr<A: Shr<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `rhs`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-consume-args.rs:62:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) {
|
2019-12-26 12:43:33 +00:00
|
|
|
| --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | lhs >> rhs;
|
|
|
|
| --- value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | drop(lhs);
|
|
|
|
LL | drop(rhs);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^ value used here after move
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
Mention when type parameter could be `Clone`
```
error[E0382]: use of moved value: `t`
--> $DIR/use_of_moved_value_copy_suggestions.rs:7:9
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
...
LL | (t, t)
| - ^ value used here after move
| |
| value moved here
|
help: if `T` implemented `Clone`, you could clone the value
--> $DIR/use_of_moved_value_copy_suggestions.rs:4:16
|
LL | fn duplicate_t<T>(t: T) -> (T, T) {
| ^ consider constraining this type parameter with `Clone`
...
LL | (t, t)
| - you could clone this value
help: consider restricting type parameter `T`
|
LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
| ++++++
```
The `help` is new. On ADTs, we also extend the output with span labels:
```
error[E0507]: cannot move out of static item `FOO`
--> $DIR/issue-17718-static-move.rs:6:14
|
LL | let _a = FOO;
| ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
|
note: if `Foo` implemented `Clone`, you could clone the value
--> $DIR/issue-17718-static-move.rs:1:1
|
LL | struct Foo;
| ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL | let _a = FOO;
| --- you could clone this value
help: consider borrowing here
|
LL | let _a = &FOO;
| +
```
2024-04-18 22:18:19 +00:00
|
|
|
help: if `B` implemented `Clone`, you could clone the value
|
|
|
|
--> $DIR/binop-consume-args.rs:59:30
|
|
|
|
|
|
|
|
|
LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) {
|
|
|
|
| ^ consider constraining this type parameter with `Clone`
|
|
|
|
LL | lhs >> rhs;
|
|
|
|
| --- you could clone this value
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `B`
|
2019-12-26 12:43:33 +00:00
|
|
|
|
|
2020-03-14 02:28:14 +00:00
|
|
|
LL | fn shr<A: Shr<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: aborting due to 20 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0382`.
|