Merge pull request #19416 from ShoyuVanilla/issue-15037

fix: Handle multiple `#[repr(..)]` attrs correctly
This commit is contained in:
Lukas Wirth 2025-03-22 17:53:24 +00:00 committed by GitHub
commit 2e5e5113df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 91 additions and 71 deletions

View file

@ -284,6 +284,18 @@ fn repr_packed() {
check_size_and_align("#[repr(Rust, packed(5))] struct Goal(i32);", "", 4, 1);
}
#[test]
fn multiple_repr_attrs() {
size_and_align!(
#[repr(C)]
#[repr(packed)]
struct Goal {
id: i32,
u: u8,
}
)
}
#[test]
fn generic() {
size_and_align! {