File tree 4 files changed +14
-3
lines changed
4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -816,15 +816,22 @@ impl Type {
816
816
}
817
817
// XXX DependentSizedArray is wrong
818
818
CXType_VariableArray |
819
- CXType_DependentSizedArray |
820
- CXType_IncompleteArray => {
819
+ CXType_DependentSizedArray => {
821
820
let inner = Item :: from_ty ( ty. elem_type ( ) . as_ref ( ) . unwrap ( ) ,
822
821
location,
823
822
parent_id,
824
823
ctx)
825
824
. expect ( "Not able to resolve array element?" ) ;
826
825
TypeKind :: Pointer ( inner)
827
826
}
827
+ CXType_IncompleteArray => {
828
+ let inner = Item :: from_ty ( ty. elem_type ( ) . as_ref ( ) . unwrap ( ) ,
829
+ location,
830
+ parent_id,
831
+ ctx)
832
+ . expect ( "Not able to resolve array element?" ) ;
833
+ TypeKind :: Array ( inner, 0 )
834
+ }
828
835
CXType_FunctionNoProto |
829
836
CXType_FunctionProto => {
830
837
let signature = try!( FunctionSig :: from_ty ( ty,
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
32
32
pub struct C {
33
33
pub a : :: std:: os:: raw:: c_int ,
34
34
pub big_array : [ :: std:: os:: raw:: c_char ; 33usize ] ,
35
+ pub zero_length_array : [ :: std:: os:: raw:: c_char ; 0usize ] ,
36
+ pub incomplete_array : [ :: std:: os:: raw:: c_char ; 0usize ] ,
35
37
}
36
38
#[ test]
37
39
fn bindgen_test_layout_C ( ) {
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ pub struct Baz {
36
36
}
37
37
extern "C" {
38
38
#[ link_name = "_ZN3Baz3FOOE" ]
39
- pub static mut Baz_FOO : * const Bar ;
39
+ pub static mut Baz_FOO : [ Bar ; 0usize ] ;
40
40
}
41
41
#[ test]
42
42
fn bindgen_test_layout_Baz ( ) {
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ class C {
2
2
int a;
3
3
// More than rust limits (32)
4
4
char big_array[33 ];
5
+ char zero_length_array[0 ];
6
+ char incomplete_array[];
5
7
};
6
8
7
9
class WithDtor {
You can’t perform that action at this time.
0 commit comments