rust/compiler/rustc_borrowck
Esteban Küber 7b62d97abd Mention implicit bounds from #[derive(Clone)] on moved value
When encountering a value that has a borrow checker error where the type was previously moved, when suggesting cloning verify that it is not already being derived. If it is, explain why the `derive(Clone)` doesn't apply:

```
note: if `TypedAddress<T>` implemented `Clone`, you could clone the value
  --> $DIR/derive-clone-implicit-bound.rs:6:1
   |
LL | #[derive(Clone, Copy)]
   |          ----- derived `Clone` adds implicit bounds on type parameters
LL | pub struct TypedAddress<T>{
   | ^^^^^^^^^^^^^^^^^^^^^^^^-^
   | |                       |
   | |                       introduces an implicit `T: Clone` bound
   | consider manually implementing `Clone` for this type
...
LL |         let old = self.return_value(offset);
   |                                     ------ you could clone this value
```
2026-02-01 18:20:30 +00:00
..
src Mention implicit bounds from #[derive(Clone)] on moved value 2026-02-01 18:20:30 +00:00
Cargo.toml Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
messages.ftl it's not a borrow checker limitation :< 2025-08-14 17:43:39 +02:00