-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing
Description
In my opinion, clippy::use_debug
should allow the debug format "{:?}"
within Debug
trait implementations. This seems to be backed up by the comment in the test here:
Lines 15 to 20 in da7aebc
impl Debug for Foo { | |
fn fmt(&self, f: &mut Formatter) -> Result { | |
// ok, we can use `Debug` formatting in `Debug` implementations | |
write!(f, "{:?}", 42.718) | |
} | |
} |
However, the expected output actually expects an error in this case
rust-clippy/tests/ui/print.stderr
Lines 9 to 13 in da7aebc
error: use of `Debug`-based formatting | |
--> $DIR/print.rs:18:19 | |
| | |
LL | write!(f, "{:?}", 42.718) | |
| ^^^^^^ |
I propose that this error be removed from the test and the code adjusted to allow for debug formatting in Debug
. If this is not desired, then the comment in tests/ui/print.rs should be removed to avoid confusion.
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing