fix: Handle multiple #[repr(..)] attrs correctly

This commit is contained in:
Shoyu Vanilla 2025-03-22 18:57:37 +09:00
parent 32fa60f3a6
commit 602b4f37b9
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! {