Closed
Description
On missing Debug
implementation, the current output is unnecessarily verbose:
error[E0277]: `Group` doesn't implement `Debug`
--> src/tests/a.rs:19:5
|
19 | assert_eq!(result.unwrap(), &group);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Group` cannot be formatted using `{:?}`
|
= help: the trait `Debug` is not implemented for `Group`
= note: add `#[derive(Debug)]` or manually implement `Debug`
= note: required because of the requirements on the impl of `Debug` for `&Group`
= note: 1 redundant requirements hidden
= note: required because of the requirements on the impl of `Debug` for `&&Group`
= note: required by `std::fmt::Debug::fmt`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
We should special case this and Display
to give less overwhelming output:
error[E0277]: `Group` doesn't implement `Debug`
--> src/tests/a.rs:19:5
|
19 | assert_eq!(result.unwrap(), &group);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Group` cannot be formatted using `{:?}`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: add `#[derive(Debug)]` to `Group` or manually `impl Debug for Group`
|
X | #[derive(Debug)] pub struct Group {
|
Taken from https://blog.frankel.ch/start-rust/1/
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: Too much output caused by a single piece of incorrect code.Relevant to the compiler team, which will review and decide on the PR/issue.