@@ -64,12 +64,13 @@ pub struct C {
64
64
pub mBConstRef : B < * const :: std:: os:: raw:: c_int > ,
65
65
pub mPtrRef : B < * mut * mut :: std:: os:: raw:: c_int > ,
66
66
pub mArrayRef : B < * mut [ :: std:: os:: raw:: c_int ; 1usize ] > ,
67
+ pub mBConstArray : B < [ :: std:: os:: raw:: c_int ; 1usize ] > ,
67
68
}
68
69
#[ test]
69
70
fn bindgen_test_layout_C ( ) {
70
71
assert_eq ! (
71
72
:: std:: mem:: size_of:: <C >( ) ,
72
- 96usize ,
73
+ 104usize ,
73
74
concat!( "Size of: " , stringify!( C ) )
74
75
) ;
75
76
assert_eq ! (
@@ -236,6 +237,18 @@ fn bindgen_test_layout_C() {
236
237
stringify!( mArrayRef)
237
238
)
238
239
) ;
240
+ assert_eq ! (
241
+ unsafe {
242
+ & ( * ( :: std:: ptr:: null:: <C >( ) ) ) . mBConstArray as * const _ as usize
243
+ } ,
244
+ 96usize ,
245
+ concat!(
246
+ "Offset of field: " ,
247
+ stringify!( C ) ,
248
+ "::" ,
249
+ stringify!( mBConstArray)
250
+ )
251
+ ) ;
239
252
}
240
253
impl Default for C {
241
254
fn default ( ) -> Self {
@@ -877,6 +890,25 @@ fn __bindgen_test_layout_B_open0_ref_array1_int_close0_instantiation() {
877
890
) ;
878
891
}
879
892
#[ test]
893
+ fn __bindgen_test_layout_B_open0_array1_const_int_close0_instantiation ( ) {
894
+ assert_eq ! (
895
+ :: std:: mem:: size_of:: <B <[ :: std:: os:: raw:: c_int; 1usize ] >>( ) ,
896
+ 4usize ,
897
+ concat!(
898
+ "Size of template specialization: " ,
899
+ stringify!( B <[ :: std:: os:: raw:: c_int; 1usize ] >)
900
+ )
901
+ ) ;
902
+ assert_eq ! (
903
+ :: std:: mem:: align_of:: <B <[ :: std:: os:: raw:: c_int; 1usize ] >>( ) ,
904
+ 4usize ,
905
+ concat!(
906
+ "Alignment of template specialization: " ,
907
+ stringify!( B <[ :: std:: os:: raw:: c_int; 1usize ] >)
908
+ )
909
+ ) ;
910
+ }
911
+ #[ test]
880
912
fn __bindgen_test_layout_Foo_open0_int_int_close0_instantiation_1 ( ) {
881
913
assert_eq ! (
882
914
:: std:: mem:: size_of:: <Foo <:: std:: os:: raw:: c_int>>( ) ,
0 commit comments