Closed
Description
Code
struct Foo {
a: &'static str
}
impl Copy for Foo {}
Current output
error[E0277]: the trait bound `Foo: Clone` is not satisfied
--> src/lib.rs:5:6
|
5 | impl Copy for Foo {}
| ^^^^ the trait `Clone` is not implemented for `Foo`
|
note: required by a bound in `Copy`
--> /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/marker.rs:391:17
|
= note: required by this bound in `Copy`
help: consider annotating `Foo` with `#[derive(Clone)]`
|
1 | #[derive(Clone)]
|
Desired output
error[E0277]: the trait bound `Foo: Clone` is not satisfied
--> src/lib.rs:5:6
|
5 | impl Copy for Foo {}
| ^^^^ the trait `Clone` is not implemented for `Foo`
|
note: required by a bound in `Copy`
--> /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/marker.rs:391:17
|
| trait Copy: Clone {
| ^^^^^ required by this bound in `Copy`
|
help: consider annotating `Foo` with `#[derive(Clone)]`
|
1 | #[derive(Clone)]
| ++++++++++++++++ // to be honest I don't remember how exactly the `+++` suggestions are structured
| struct Foo {
Rationale and extra context
An empty not is rather confusing and really has no reason to exist and just takes up space, it should actually point to the supertrait like every other error imo (or at the very least have the note removed..) It also seems a bit weird to me that the compiler suggests adding #[derive(Clone)]
but doesnt make it an actual suggestion with the nice green ++++
Other cases
No response
Anything else?
No response