@@ -30,26 +30,6 @@ impl Clone for A_B {
30
30
fn clone ( & self ) -> Self { * self }
31
31
}
32
32
#[ repr( C ) ]
33
- #[ derive( Debug , Default , Copy , Hash , PartialEq , Eq ) ]
34
- pub struct A_C {
35
- pub baz : :: std:: os:: raw:: c_int ,
36
- }
37
- #[ test]
38
- fn bindgen_test_layout_A_C ( ) {
39
- assert_eq ! ( :: std:: mem:: size_of:: <A_C >( ) , 4usize , concat ! (
40
- "Size of: " , stringify ! ( A_C ) ) ) ;
41
- assert_eq ! ( :: std:: mem:: align_of:: <A_C >( ) , 4usize , concat ! (
42
- "Alignment of " , stringify ! ( A_C ) ) ) ;
43
- assert_eq ! ( unsafe {
44
- & ( * ( 0 as * const A_C ) ) . baz as * const _ as usize } ,
45
- 0usize , concat ! (
46
- "Alignment of field: " , stringify ! ( A_C ) , "::" ,
47
- stringify ! ( baz ) ) ) ;
48
- }
49
- impl Clone for A_C {
50
- fn clone ( & self ) -> Self { * self }
51
- }
52
- #[ repr( C ) ]
53
33
#[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
54
34
pub struct A_D < T > {
55
35
pub foo : T ,
@@ -73,6 +53,26 @@ fn bindgen_test_layout_A() {
73
53
impl Clone for A {
74
54
fn clone ( & self ) -> Self { * self }
75
55
}
56
+ #[ repr( C ) ]
57
+ #[ derive( Debug , Default , Copy , Hash , PartialEq , Eq ) ]
58
+ pub struct C {
59
+ pub baz : :: std:: os:: raw:: c_int ,
60
+ }
61
+ #[ test]
62
+ fn bindgen_test_layout_C ( ) {
63
+ assert_eq ! ( :: std:: mem:: size_of:: <C >( ) , 4usize , concat ! (
64
+ "Size of: " , stringify ! ( C ) ) ) ;
65
+ assert_eq ! ( :: std:: mem:: align_of:: <C >( ) , 4usize , concat ! (
66
+ "Alignment of " , stringify ! ( C ) ) ) ;
67
+ assert_eq ! ( unsafe {
68
+ & ( * ( 0 as * const C ) ) . baz as * const _ as usize } ,
69
+ 0usize , concat ! (
70
+ "Alignment of field: " , stringify ! ( C ) , "::" , stringify
71
+ ! ( baz ) ) ) ;
72
+ }
73
+ impl Clone for C {
74
+ fn clone ( & self ) -> Self { * self }
75
+ }
76
76
extern "C" {
77
77
#[ link_name = "var" ]
78
78
pub static mut var: A_B ;
0 commit comments