Esteban Küber
d68f2a6b71
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-24 22:21:15 +00:00
..
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-01-09 21:08:16 +00:00
2024-03-07 14:26:31 +00:00
2024-01-09 21:08:16 +00:00
2024-01-09 21:08:16 +00:00
2023-12-06 11:05:22 +01:00
2023-12-06 11:05:22 +01:00
2023-12-06 11:05:22 +01:00
2023-12-06 11:05:22 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-10-09 11:47:02 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-04-16 11:11:50 +05:30
2024-04-16 11:11:50 +05:30
2023-11-24 19:15:52 +01:00
2024-02-08 08:10:43 +00:00
2024-02-08 08:10:43 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-14 11:00:30 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-07 14:26:31 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-10-30 22:12:07 +00:00
2023-10-30 22:12:07 +00:00
2023-08-26 19:35:54 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-04-11 16:41:41 +00:00
2024-04-11 16:41:41 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-10-17 17:33:55 +00:00
2024-01-24 02:53:15 +00:00
2024-01-24 02:53:15 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-07 14:26:31 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-01-24 02:53:15 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-12-12 17:40:53 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-12-12 17:40:53 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-01-02 14:17:56 +00:00
2024-01-02 14:17:56 +00:00
2024-01-02 14:17:56 +00:00
2024-01-02 14:17:56 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-09-23 00:57:17 +00:00
2024-01-30 21:28:18 +00:00
2024-03-10 23:23:46 -04:00
2024-03-10 23:23:46 -04:00
2024-03-10 23:23:46 -04:00
2024-03-10 23:23:46 -04:00
2024-03-10 23:23:46 -04:00
2024-03-10 23:23:46 -04:00
2024-02-01 03:30:26 +00:00
2023-12-07 23:00:46 -05:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2023-11-24 19:15:52 +01:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-03-04 21:06:52 +01:00
2024-03-04 21:06:52 +01:00
2023-11-24 19:15:52 +01:00
2024-01-19 23:55:05 +00:00
2024-01-22 17:52:36 +00:00
2024-01-19 23:55:05 +00:00
2024-01-19 23:55:05 +00:00
2024-01-19 23:55:05 +00:00
2024-01-19 23:55:05 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-03-01 13:48:20 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2023-11-24 19:15:52 +01:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-04-21 15:43:43 -03:00
2024-04-21 15:43:43 -03:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-10-30 22:19:17 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-01-11 09:03:26 +00:00
2024-01-11 09:03:26 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-01-02 15:34:37 -05:00
2024-04-24 22:21:15 +00:00
2024-03-03 16:30:48 -03:00
2024-03-03 16:30:48 -03:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-08-28 17:47:37 -03:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-14 11:00:30 +00:00
2024-03-07 06:27:09 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-01-30 21:28:18 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2023-11-24 19:15:52 +01:00
2024-03-08 20:56:25 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-01-30 21:28:18 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-09-09 18:00:13 +02:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-19 17:45:02 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-09-10 21:20:36 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-18 16:44:12 +00:00
2024-03-18 16:44:12 +00:00
2024-03-18 16:44:12 +00:00
2024-02-01 03:30:26 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00