diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-03-04 03:21:11 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-03-04 03:54:17 +0100 |
commit | 9134679a98703879ddd081fe14b64cfae074de4a (patch) | |
tree | 5fbfa8eb722f630ebd59c5d3213daff671882511 /src/codegen/mod.rs | |
parent | ed6e1bbec439e8b260e6e701379fc70d295f35fe (diff) |
codegen: Properly track alignment of unions.
This makes us not unnecessarily add repr(align) to unions.
Closes #1498.
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r-- | src/codegen/mod.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 2d71942c..d7f98c13 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -1589,6 +1589,7 @@ impl CodeGenerator for CompInfo { // TODO(emilio): It'd be nice to unify this with the struct path // above somehow. let layout = layout.expect("Unable to get layout information?"); + struct_layout.saw_union(layout); if struct_layout.requires_explicit_align(layout) { explicit_align = Some(layout.align); @@ -1600,8 +1601,6 @@ impl CodeGenerator for CompInfo { _bindgen_union_align: #ty , } } else { - struct_layout.saw_union(layout); - quote! { pub bindgen_union_field: #ty , } |