Skip to content

Conversation

FenrirWolf
Copy link
Member

@FenrirWolf FenrirWolf commented May 13, 2025

A new version of libctru was released a few days ago and it added some structs that bindgen ends up choking on. It turns out that Rust doesn't allow #[repr(packed)] structs to transitively contain #[repr(align)] structs due to differing behavior between gcc and msvc toolchains. There is an RFC in the works to find a long-term solution to this issue, but in the meantime we can work around the problem by just treating the problematic types as opaque blobs of bytes.

This fixes an issue where Rust doesn't allow `#[repr(packed)]` structs to
transitively contain `#[repr(align)]` structs due to differing behavior
between gcc and msvc toolchains.
@FenrirWolf FenrirWolf requested a review from a team as a code owner May 13, 2025 23:10
@FenrirWolf FenrirWolf merged commit 2b2e0ed into rust3ds:master May 14, 2025
2 of 4 checks passed
@FenrirWolf FenrirWolf deleted the new_opaque_types branch May 14, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant