You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suggestion: say "field is never read" instead of "field is never used" #64465
pubstructOwl{tree:u16}fnexist(tree:u16) -> bool{ tree > 0 && tree <= 3}implOwl{pubfnfind(tree:u16) -> Option<Owl>{ifexist(tree){Some(Owl{ tree })}else{None}}}fnmain(){Owl::find(1);}
gives the warning:
warning: field is never used: `tree`
--> src/main.rs:5:18
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; the Owl::find method most certainly uses the tree 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.
Activity
[-]Suggestion[/-][+]Suggestion: say "field is never read" instead of "field is never used" [/+]XiangQingW commentedon Oct 6, 2019
@rustbot claim
tesuji commentedon Oct 17, 2019
Ping @XiangQingW , do you still working on it?
XiangQingW commentedon Oct 19, 2019
@lzutao Not yet. I'm working on other issues currently. Please take it if you want.
CosineP commentedon Nov 16, 2019
i will take it? @rustbot claim? first time sorry
rustbot commentedon Nov 16, 2019
Error: Parsing assign command in comment failed: ...tbot claim|error: expected end of command at >|? first ti...
Please let
@rust-lang/releaseknow if you're having trouble with this bot.jplatte commentedon Nov 16, 2019
@CosineP I think rostbot was confused by the questionmark after
claim;)CosineP commentedon Nov 16, 2019
@rustbot claim
Rollup merge of rust-lang#66469 - CosineP:fix/field-lint, r=petrochenkov
Rollup merge of rust-lang#66469 - CosineP:fix/field-lint, r=petrochenkov