Do not suggest manual impl Copy
This commit is contained in:
parent
dffec20dee
commit
c95210f013
5 changed files with 1 additions and 7 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue