diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-03-04 03:55:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-04 03:55:18 +0100 |
commit | 3a6864cf9a76916c002c41a8ae813d9f8bd9853e (patch) | |
tree | e0335d4c4de7b34e141f055b32fa3a22ecd55771 /src/codegen | |
parent | 1cd830127489b19a58143c300667d045b447a62d (diff) | |
parent | a43cc2afcd69cbaa2f699ee3d4b9c804576ffad7 (diff) |
Merge pull request #1530 from emilio/rustup
Update default rust target to 1.33.
Diffstat (limited to 'src/codegen')
-rw-r--r-- | src/codegen/mod.rs | 3 | ||||
-rw-r--r-- | src/codegen/struct_layout.rs | 6 |
2 files changed, 4 insertions, 5 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 , } diff --git a/src/codegen/struct_layout.rs b/src/codegen/struct_layout.rs index 921ab215..29d281aa 100644 --- a/src/codegen/struct_layout.rs +++ b/src/codegen/struct_layout.rs @@ -85,9 +85,9 @@ impl<'a> StructLayoutTracker<'a> { name: &'a str, ) -> Self { StructLayoutTracker { - name: name, - ctx: ctx, - comp: comp, + name, + ctx, + comp, is_packed: comp.is_packed(ctx, &ty.layout(ctx)), latest_offset: 0, padding_count: 0, |