We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdee9f1 commit 55bc2b1Copy full SHA for 55bc2b1
src/codegen/mod.rs
@@ -1600,14 +1600,20 @@ impl CodeGenerator for CompInfo {
1600
);
1601
}
1602
1603
- if is_union && !ctx.options().unstable_rust {
+ if is_union {
1604
let layout = layout.expect("Unable to get layout information?");
1605
let ty = BlobTyBuilder::new(layout).build();
1606
- let field = StructFieldBuilder::named("bindgen_union_field")
1607
- .pub_()
1608
- .build_ty(ty);
+
+ let field = if ctx.options().unstable_rust {
+ StructFieldBuilder::named("_bindgen_union_align")
1609
+ .build_ty(ty)
1610
+ } else {
1611
+ struct_layout.saw_union(layout);
1612
- struct_layout.saw_union(layout);
1613
+ StructFieldBuilder::named("bindgen_union_field")
1614
+ .pub_()
1615
1616
+ };
1617
1618
fields.push(field);
1619
0 commit comments