-
Notifications
You must be signed in to change notification settings - Fork 13k
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
improper_ctypes
lint triggers on valid #[repr(transparent)]
types
#115457
Comments
I find it odd that this doesn't lint on |
If it's an easier pill to swallow, it also lints on Note that using zero-sized types to represent opaque/extern types like this is a documented pattern, so the lint should definitely not fire there. |
@rustbot claim |
Actually, I just saw this Pre-RFC about |
|
I find that ignoring the warning conditions for the example seems easy to implement, but there doesn't seem to be a definite conclusion here. I think we should continue the discussion in this issue rust-lang/rust#100954 |
nb: It also fails to trigger on invalid |
Code
Current output
Desired output
Rationale and extra context
Reproducible from Rust 1.57.0 (where
#[repr(transparent)]
on a zero-sized struct was made valid) to the currentnightly-2023-08-31
.The text was updated successfully, but these errors were encountered: