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
False positive "field is never read" warnings #81626
Oops, sorry! Technically, Foo.data field is, in fact, never read. What went wrong is Foo.data is written and read through other ways.
I think restricting the lint to non-reference fields should work, and will submit a PR to do so quickly. Please double check whether my thinking is correct.
Ah, yeah, I somehow thought that the macro was needed to trigger the bug but it is not. That sounds good. Writes to mutable references have side effects so doing that seems ok.
Would that also cover this case here, in the idna crate? (The Mapper::errors field is a &mut reference to an Errors type, which is in fact returned to the caller of processing().)
Activity
emilio commentedon Feb 1, 2021
Seems like this is a regression from d3c69a4.
emilio commentedon Feb 1, 2021
cc @sanxiyn
sanxiyn commentedon Feb 2, 2021
Oops, sorry! Technically,
Foo.datafield is, in fact, never read. What went wrong isFoo.datais written and read through other ways.I think restricting the lint to non-reference fields should work, and will submit a PR to do so quickly. Please double check whether my thinking is correct.
emilio commentedon Feb 2, 2021
Ah, yeah, I somehow thought that the macro was needed to trigger the bug but it is not. That sounds good. Writes to mutable references have side effects so doing that seems ok.
djc commentedon Feb 8, 2021
Would that also cover this case here, in the idna crate? (The
Mapper::errorsfield is a&mutreference to anErrorstype, which is in fact returned to the caller ofprocessing().)https://github.com/servo/rust-url/pull/674/checks?check_run_id=1855869353
emilio commentedon Feb 8, 2021
Yeah, I think it's the same.
Rollup merge of rust-lang#82297 - tmiasko:write-only, r=oli-obk
Rollup merge of rust-lang#82297 - tmiasko:write-only, r=oli-obk
Rollup merge of rust-lang#82297 - tmiasko:write-only, r=oli-obk
pnkfelix commentedon Mar 10, 2021
Ah, this was closed, but the bug leaked into beta (as mentioned in #81658) while the fix is only in nightly.
Reopening and tagging as stable-to-beta regression
6 remaining items
pnkfelix commentedon Mar 15, 2021
As noted on #81473 (comment) , we're going to resolve the beta issue by reverting PR #81473 on beta (which I have assigned myself to take care of).
Auto merge of rust-lang#83171 - pnkfelix:revert-81473-warn-write-only…
emilyalbini commentedon Apr 30, 2021
This was a regression affecting beta 1.51, closing this.
Rollup merge of rust-lang#145214 - notJoon:fix/enable-self-assignment…
Rollup merge of rust-lang#145214 - notJoon:fix/enable-self-assignment…
Rollup merge of rust-lang#145214 - notJoon:fix/enable-self-assignment…
Rollup merge of rust-lang#145214 - notJoon:fix/enable-self-assignment…
Rollup merge of rust-lang#145214 - notJoon:fix/enable-self-assignment…
Rollup merge of rust-lang#145214 - notJoon:fix/enable-self-assignment…
Rollup merge of rust-lang#145214 - notJoon:fix/enable-self-assignment…
Unrolled build for #145214