Skip to content
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

unread field warnings on nightly #1330

Closed
joshtriplett opened this issue Mar 26, 2024 · 1 comment
Closed

unread field warnings on nightly #1330

joshtriplett opened this issue Mar 26, 2024 · 1 comment

Comments

@joshtriplett
Copy link
Contributor

A build with nightly Rust gives a bunch of "fields x and y are never read" warnings. Wanted to give a heads up on those before they hit stable.

Byron added a commit that referenced this issue Mar 27, 2024
It's interesting to note that one of these warnings constitute
reading the fields, but these come about by displaying a
debug version of these fields, which now doesn't qualify anymore.
Byron added a commit that referenced this issue Mar 27, 2024
It's interesting to note that one of these warnings constitute
reading the fields, but these come about by displaying a
debug version of these fields, which now doesn't qualify anymore.
@Byron
Copy link
Member

Byron commented Mar 27, 2024

Thanks for letting me know!

I have addressed the issue in the linked commit. Once (in gix-index) the warning was legit and stems from not actually using all extension data that is read (and it's not completely written back either.

However, another warning gitoxide-core was a little different as the code is explicitly writing a debug version of the top-level struct in order to avoid having to implement Display. Debug doesn't count anymore as use, which is understandable, and the whole sub-command is kind of a debugging tool anyway. In this case, the best choice seemed to be to suppress the warning.

@Byron Byron closed this as completed Mar 27, 2024
Byron added a commit that referenced this issue Apr 3, 2024
It's interesting to note that one of these warnings constitute
reading the fields, but these come about by displaying a
debug version of these fields, which now doesn't qualify anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants