about summary refs log tree commit diff
path: root/tests/ui/error-codes/E0504.stderr
AgeCommit message (Collapse)AuthorLines
2024-07-26Peel off explicit (or implicit) deref before suggesting clone on move error ↵Michael Goulet-1/+1
in borrowck
2024-04-24Mention when type parameter could be `Clone`Esteban Küber-1/+4
``` 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-11Mention when the type of the moved value doesn't implement `Clone`Esteban Küber-0/+6
2024-04-11Fix accuracy of `T: Clone` check in suggestionEsteban Küber-6/+0
2024-04-11Account for unops when suggesting cloningEsteban Küber-2/+3
2024-04-11Suggest `.clone()` when moved while borrowedEsteban Küber-0/+5
2023-11-24Show number in error message even for one errorNilstrieb-1/+1
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-01-15Tweak E0597Esteban Küber-0/+2
CC #99430
2023-01-11Move /src/test to /testsAlbert Larsan-0/+17