repr_transparent_external_private_fields
lint fires on ManuallyDrop
containing a ZST
#129470
Labels
A-repr
Area: the `#[repr(stuff)]` attribute
L-repr_transparent_external_private_fields
Lint: repr_transparent_external_private_fields
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Consider the following code:
the field
md
fires a lint warning:While the spirit of the lint seems reasonable, the docs state:
So in this case, it seems like
ManuallyDrop
changing size would be a breaking change, and the lint at the very least misleading here. Perhaps an exclusion is needed on this lint forManuallyDrop
?More generally, quoting the nomicon:
So, in
ManuallyDrop
's case, the single field is not pub, but the layout is documented in prose and so should be considered part of the ABI. Is it possible there are other types out there with such a layout guarantee in prose, which might also be incorrectly flagged by this lint?The text was updated successfully, but these errors were encountered: