]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #82297 - tmiasko:write-only, r=oli-obk
authorDylan DPC <dylan.dpc@gmail.com>
Tue, 23 Feb 2021 15:10:25 +0000 (16:10 +0100)
committerGitHub <noreply@github.com>
Tue, 23 Feb 2021 15:10:25 +0000 (16:10 +0100)
Consider auto derefs before warning about write only fields

Changes from #81473 extended the dead code lint with an ability to detect
fields that are written to but never read from. The implementation skips
over fields on the left hand side of an assignment, without marking them
as live.

A field access might involve an automatic dereference and de-facto read
the field. Conservatively mark expressions with deref adjustments as
live to avoid generating false positive warnings.

Closes #81626.


Trivial merge