diff options
-rw-r--r-- | bindgen/codegen/mod.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bindgen/codegen/mod.rs b/bindgen/codegen/mod.rs index b5a7b27c..df7602a9 100644 --- a/bindgen/codegen/mod.rs +++ b/bindgen/codegen/mod.rs @@ -2084,7 +2084,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. |