-
Notifications
You must be signed in to change notification settings - Fork 763
Closed
Labels
Description
Input C/C++ Header
struct T {};
struct U {
void test(T a);
};
Bindgen Invocation
$ bindgen input.hpp --generate types --whitelist-type U
Actual Results
#[repr(C)]
#[derive(Debug, Copy)]
pub struct U {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_U() {
assert_eq!(::std::mem::size_of::<U>() , 1usize , concat ! (
"Size of: " , stringify ! ( U ) ));
assert_eq! (::std::mem::align_of::<U>() , 1usize , concat ! (
"Alignment of " , stringify ! ( U ) ));
}
impl Clone for U {
fn clone(&self) -> Self { *self }
}
Expected Results
Not really expected result, but before #827, it generates
#[repr(C)]
#[derive(Debug, Copy)]
pub struct T {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_T() {
assert_eq!(::std::mem::size_of::<T>() , 1usize , concat ! (
"Size of: " , stringify ! ( T ) ));
assert_eq! (::std::mem::align_of::<T>() , 1usize , concat ! (
"Alignment of " , stringify ! ( T ) ));
}
impl Clone for T {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct U {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_U() {
assert_eq!(::std::mem::size_of::<U>() , 1usize , concat ! (
"Size of: " , stringify ! ( U ) ));
assert_eq! (::std::mem::align_of::<U>() , 1usize , concat ! (
"Alignment of " , stringify ! ( U ) ));
}
impl Clone for U {
fn clone(&self) -> Self { *self }
}