field is never read warning doesn't consider Drop implementation #112290
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
Since the struct
A
is public and constructible, the compiler should assume that the drop for all itsDrop
fields will be called, which in this case makes the issued warning wrong.Other cases
No response
Anything else?
Tested on 1.70.0 and on today's nightly (398fa21 2023-06-03).
The text was updated successfully, but these errors were encountered: