-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Suggestion: say "field is never read" instead of "field is never used" #64465
Comments
@rustbot claim |
Ping @XiangQingW , do you still working on it? |
@lzutao Not yet. I'm working on other issues currently. Please take it if you want. |
i will take it? @rustbot claim? first time sorry |
Error: Parsing assign command in comment failed: ...tbot claim|error: expected end of command at >|? first ti... Please let |
@CosineP I think rostbot was confused by the questionmark after |
@rustbot claim |
Use "field is never read" instead of "field is never used" this is my first PR here so please let me know if i am doing it wrong closes rust-lang#64465 i will be referencing this with a book PR that updates the same language
As of rustc 1.37.0, this code:
gives the warning:
I understand that the compiler can optimize out the
tree
field. Forgive me for stating the obvious; namely, the warning doesn't mention anything about "optimizing away" the field; it only says "field is never used". A user would be justified in thinking: "this warning doesn't make sense; theOwl::find
method most certainly uses thetree
field.Suggestion
I'd suggest changing the warning to say "warning: field is never read".
Rationale
By the common understanding of the word 'use', the
tree
field indeed is 'used', because the word 'use' can mean 'read' or 'write'. Being more specific (i.e. saying "field is never read") will help users understand what kind of use the compiler means.This issue has been assigned to @CosineP via this comment.
The text was updated successfully, but these errors were encountered: