derive(Default) suppresses warn(dead_code) #98871
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: [playground]
The current output is:
Ideally the output should look like:
After the derive, the code looks roughly like
As the default implementation is both 1) itself unused and 2)
#[automatically_derived]
, ideally it should not count as a use for suppressing thedead_code
lint onT
.The derived implementations for
Clone
,Debug
,PartialEq
, andHash
also show this behavior.I seem to recall a previous change to
#[automatically_derived]
to change the interaction between the unused code lint and derived implementations, but could not find it offhand.The text was updated successfully, but these errors were encountered: