Do not suggest manual impl Copy

This commit is contained in:
Esteban Küber 2026-02-01 18:30:08 +00:00
parent dffec20dee
commit c95210f013
5 changed files with 1 additions and 7 deletions

View file

@ -3629,7 +3629,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
}
}
err.span_note(spans, msg);
if derived {
if derived && trait_name != "Copy" {
err.help(format!(
"consider manually implementing `{trait_name}` to avoid undesired \
bounds",

View file

@ -159,7 +159,6 @@ LL | pub enum ColumnInsertValue<Col, Expr> where
...
LL | Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>,
| ------------------------------------------------ unsatisfied trait bound
= help: consider manually implementing `Copy` to avoid undesired bounds
help: consider further restricting the associated type
|
LL | Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>, <Col as Expression>::SqlType: NotNull,

View file

@ -11,7 +11,6 @@ LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct Foo<T>(T);
| ^^^ - type parameter would need to implement `Copy`
= help: consider manually implementing `Copy` to avoid undesired bounds
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: create an inline `const` block
|

View file

@ -13,7 +13,6 @@ LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct B<T> {
| ^ - type parameter would need to implement `Copy`
= help: consider manually implementing `Copy` to avoid undesired bounds
note: required by a bound in `is_copy`
--> $DIR/deriving-copyclone.rs:18:15
|
@ -65,7 +64,6 @@ LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct B<T> {
| ^ - type parameter would need to implement `Copy`
= help: consider manually implementing `Copy` to avoid undesired bounds
note: required by a bound in `is_copy`
--> $DIR/deriving-copyclone.rs:18:15
|

View file

@ -35,7 +35,6 @@ LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct Fooy<T>(T);
| ^^^^ - type parameter would need to implement `Copy`
= help: consider manually implementing `Copy` to avoid undesired bounds
note: the requirement `Fooy<T>: Copy` appears on the `impl`'s associated type `C` but not on the corresponding trait's associated type
--> $DIR/impl_bounds.rs:6:10
|
@ -62,7 +61,6 @@ LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct Fooy<T>(T);
| ^^^^ - type parameter would need to implement `Copy`
= help: consider manually implementing `Copy` to avoid undesired bounds
note: the requirement `Fooy<T>: Copy` appears on the `impl`'s associated function `d` but not on the corresponding trait's associated function
--> $DIR/impl_bounds.rs:7:8
|