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.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input:
#include <stdint.h> struct Test { uint64_t x : 56; uint64_t y : 8; };
On 32 bit, rust-bindgen generates:
impl Test { ... #[inline] pub fn new_bitfield_1( x: u64, y: u64, ) -> __BindgenBitfieldUnit<[u8; 8usize], u64> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< [u8; 8usize], u64, > = Default::default(); __bindgen_bitfield_unit.set(0usize, 56u8, { let x: [u32; 2usize] = unsafe { ::std::mem::transmute(x) }; x as u64 }); __bindgen_bitfield_unit.set(56usize, 8u8, { let y: [u32; 2usize] = unsafe { ::std::mem::transmute(y) }; y as u64 }); __bindgen_bitfield_unit }
This fails to compile with non-primitive cast: '[u32; 2usize]' as 'u64' errors.
non-primitive cast: '[u32; 2usize]' as 'u64'
The text was updated successfully, but these errors were encountered:
Fix BitfieldUnit constructor to handle 64 bit wide bitfields on 32 bit.
604a447
Fixes rust-lang#1639.
830e25a
22b1094
Fixes #1639.
Successfully merging a pull request may close this issue.
Input:
On 32 bit, rust-bindgen generates:
This fails to compile with
non-primitive cast: '[u32; 2usize]' as 'u64'
errors.The text was updated successfully, but these errors were encountered: