File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ impl <T> ::std::fmt::Debug for __IncompleteArrayField<T> {
31
31
fmt. write_str ( "__IncompleteArrayField" )
32
32
}
33
33
}
34
+ impl < T > :: std:: clone:: Clone for __IncompleteArrayField < T > {
35
+ #[ inline]
36
+ fn clone ( & self ) -> Self { Self :: new ( ) }
37
+ }
38
+ impl < T > :: std:: marker:: Copy for __IncompleteArrayField < T > { }
34
39
#[ repr( C ) ]
35
40
pub struct __BindgenUnionField < T > ( :: std:: marker:: PhantomData < T > ) ;
36
41
impl < T > __BindgenUnionField < T > {
@@ -112,6 +117,16 @@ fn bindgen_test_layout_WithDtor() {
112
117
assert_eq ! ( :: std:: mem:: align_of:: <WithDtor >( ) , 4usize ) ;
113
118
}
114
119
#[ repr( C ) ]
120
+ pub struct IncompleteArrayNonCopiable {
121
+ pub whatever : * mut :: std:: os:: raw:: c_void ,
122
+ pub incomplete_array : __IncompleteArrayField < C > ,
123
+ }
124
+ #[ test]
125
+ fn bindgen_test_layout_IncompleteArrayNonCopiable ( ) {
126
+ assert_eq ! ( :: std:: mem:: size_of:: <IncompleteArrayNonCopiable >( ) , 8usize ) ;
127
+ assert_eq ! ( :: std:: mem:: align_of:: <IncompleteArrayNonCopiable >( ) , 8usize ) ;
128
+ }
129
+ #[ repr( C ) ]
115
130
#[ derive( Debug , Copy ) ]
116
131
pub struct Union {
117
132
pub d : __BindgenUnionField < f32 > ,
Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ class WithDtor {
32
32
~WithDtor () {}
33
33
};
34
34
35
+ class IncompleteArrayNonCopiable {
36
+ void * whatever;
37
+ C incomplete_array[];
38
+ };
39
+
35
40
union Union {
36
41
float d;
37
42
int i;
You can’t perform that action at this time.
0 commit comments