-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Aug 23, 2024
jieyouxu
added
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
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.
labels
Aug 23, 2024
GrigorenkoPV
added a commit
to GrigorenkoPV/rust
that referenced
this issue
Aug 24, 2024
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Aug 25, 2024
…rnal_private_fields, r=compiler-errors repr_transparent_external_private_fields: special-case some std types Fixes rust-lang#129470 `@rustbot` label +A-lint +L-repr_transparent_external_private_fields
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Aug 25, 2024
…rnal_private_fields, r=compiler-errors repr_transparent_external_private_fields: special-case some std types Fixes rust-lang#129470 ``@rustbot`` label +A-lint +L-repr_transparent_external_private_fields
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Aug 25, 2024
Rollup merge of rust-lang#129487 - GrigorenkoPV:repr_transparent_external_private_fields, r=compiler-errors repr_transparent_external_private_fields: special-case some std types Fixes rust-lang#129470 ```@rustbot``` label +A-lint +L-repr_transparent_external_private_fields
saethlin
removed
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Aug 26, 2024
Thanks @GrigorenkoPV @compiler-errors ! |
workingjubilee
added
A-repr
Area: the `#[repr(stuff)]` attribute
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
and removed
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Nov 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: