New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
field "never read" warning for field that is used by derive(Debug) #123068
Comments
Derived code is intentionally ignored for dead code analysis - if you try just use std::str;
#[derive(Debug)]
enum ProcessError {
Utf8(str::Utf8Error),
Other,
} You'll get a note explaining this. The note doesn't seem to be attached for |
Ah, so it's intentional. Interesting. I assume the solution is to mark it with |
@rustbot claim |
@rustbot release-assignment |
@rustbot claim |
Note that while getting a warning if |
As mentioned above, the fix for this issue is adding a note about how derived traits are intentionally ignored, not to stop ignoring them. |
I tried this code:
I expected to see this happen: build cleanly
Instead, this happened:
Running the program shows the field is used:
Meta
Rust version 1.77.0 (tested in playground)
The text was updated successfully, but these errors were encountered: