Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,9 @@ impl CodeGenerator for CompInfo {
attributes.push(attributes::repr("C"));
}

if ctx.options().rust_features().repr_align {
if ctx.options().rust_features().repr_align && !packed {
// We can't specify both packed(N) and align(N), but the align()
// should be redundant in this case.
if let Some(explicit) = explicit_align {
// Ensure that the struct has the correct alignment even in
// presence of alignas.
Expand Down
1 change: 0 additions & 1 deletion tests/expectations/struct_with_anon_struct_array_float.rs

This file was deleted.

38 changes: 38 additions & 0 deletions tests/expectations/tests/packed-align-conflict.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions tests/headers/packed-align-conflict.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
struct FndrOpaqueInfo {
char opaque[16];
} __attribute__((aligned(2), packed));