-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
The seemingly contradictory #[repr(Rust, C)]
is allowed
#116825
Comments
#[repr(Rust)]
and other representations#[repr(Rust, OTHER)]
#[repr(Rust, OTHER)]
#[repr(Rust, OTHER_REPR_HINT)]
Seems pretty obvious we should have exactly one repr, and only allow repr modifiers like |
#[repr(Rust, OTHER_REPR_HINT)]
#[repr(Rust, C)]
is allowed
#[repr(Rust, C)]
is allowed#[repr(Rust, C)]
is allowed
Should a C-struct be able to contain a Rust-struct ? If not, it might deserve it's own issue? |
That seems kosher to me? It might not be if #[repr(C)]
pub struct ReprC(ReprRust, ReprRust); But that's a different matter and has more to do with defining tuples in C being unclear. |
Make `#[repr(Rust)]` incompatible with other (non-modifier) representation hints like `C` and `simd` Read more about this change here: rust-lang#116829 (comment). Fixes [after backport] rust-lang#116825.
Rollup merge of rust-lang#116829 - fmease:rust-aint-c, r=compiler-errors Make `#[repr(Rust)]` incompatible with other (non-modifier) representation hints like `C` and `simd` Read more about this change here: rust-lang#116829 (comment). Fixes [after backport] rust-lang#116825.
#[repr(Rust)]
is already on beta and will soon hit stable.I just found out that
#[repr(C, Rust)]
successfully compiles while I expected it to error due to contradictory representations.Further, I wonder if(see err's response)#[repr(Rust, transparent)]
should be allowed? Currently it errors with E0692, transparent struct cannot have other repr hints.The text was updated successfully, but these errors were encountered: