diff options
author | Sergey Pepyakin <s.pepyakin@gmail.com> | 2017-10-11 15:09:27 +0300 |
---|---|---|
committer | Sergey Pepyakin <s.pepyakin@gmail.com> | 2017-10-11 15:09:27 +0300 |
commit | 2a57d7c250da6097be677067c94d093a3e554080 (patch) | |
tree | 2f9c5ed2be3f2f8dbc253e0ba0b9a02752b286b2 /src/codegen/struct_layout.rs | |
parent | 83156461266e80c426dcd4aee135a17b1dab3f18 (diff) |
Refactor requires_explicit_align
Diffstat (limited to 'src/codegen/struct_layout.rs')
-rw-r--r-- | src/codegen/struct_layout.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/codegen/struct_layout.rs b/src/codegen/struct_layout.rs index 06059853..c3c781cb 100644 --- a/src/codegen/struct_layout.rs +++ b/src/codegen/struct_layout.rs @@ -288,18 +288,9 @@ impl<'a> StructLayoutTracker<'a> { } } - pub fn align_struct(&self, layout: Layout) -> Option<quote::Tokens> { - if self.max_field_align < layout.align && + pub fn requires_explicit_align(&self, layout: Layout) -> bool { + self.max_field_align < layout.align && layout.align <= mem::size_of::<*mut ()>() - { - let ty = helpers::blob(Layout::new(0, layout.align)); - - Some(quote! { - pub __bindgen_align: #ty , - }) - } else { - None - } } fn padding_bytes(&self, layout: Layout) -> usize { |