File tree Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -971,6 +971,10 @@ impl TypeCollector for CompInfo {
971
971
types. insert ( ty) ;
972
972
}
973
973
974
+ for & var in self . inner_vars ( ) {
975
+ types. insert ( var) ;
976
+ }
977
+
974
978
// FIXME(emilio): Methods, VTable?
975
979
}
976
980
}
Original file line number Diff line number Diff line change @@ -202,6 +202,9 @@ impl TypeCollector for Item {
202
202
// be opaque, so we trace across it.
203
203
types. insert ( fun. signature ( ) ) ;
204
204
}
205
+ ItemKind :: Var ( ref var) => {
206
+ types. insert ( var. ty ( ) ) ;
207
+ }
205
208
_ => { } // FIXME.
206
209
}
207
210
}
Original file line number Diff line number Diff line change
1
+ /* automatically generated by rust-bindgen */
2
+
3
+
4
+ #![ allow( non_snake_case) ]
5
+
6
+
7
+ #[ repr( C ) ]
8
+ #[ derive( Debug , Copy ) ]
9
+ pub struct Bar {
10
+ pub m_baz : :: std:: os:: raw:: c_int ,
11
+ }
12
+ #[ test]
13
+ fn bindgen_test_layout_Bar ( ) {
14
+ assert_eq ! ( :: std:: mem:: size_of:: <Bar >( ) , 4usize ) ;
15
+ assert_eq ! ( :: std:: mem:: align_of:: <Bar >( ) , 4usize ) ;
16
+ }
17
+ extern "C" {
18
+ #[ link_name = "_ZN3BarC1Ei" ]
19
+ pub fn Bar_Bar ( this : * mut Bar , baz : :: std:: os:: raw:: c_int ) ;
20
+ }
21
+ impl Clone for Bar {
22
+ fn clone ( & self ) -> Self { * self }
23
+ }
24
+ impl Bar {
25
+ #[ inline]
26
+ pub unsafe fn new ( baz : :: std:: os:: raw:: c_int ) -> Self {
27
+ let mut __bindgen_tmp = :: std:: mem:: uninitialized ( ) ;
28
+ Bar_Bar ( & mut __bindgen_tmp, baz) ;
29
+ __bindgen_tmp
30
+ }
31
+ }
32
+ #[ repr( C ) ]
33
+ #[ derive( Debug , Copy ) ]
34
+ pub struct Baz {
35
+ pub _address : u8 ,
36
+ }
37
+ extern "C" {
38
+ #[ link_name = "_ZN3Baz3FOOE" ]
39
+ pub static mut Baz_FOO : * const Bar ;
40
+ }
41
+ #[ test]
42
+ fn bindgen_test_layout_Baz ( ) {
43
+ assert_eq ! ( :: std:: mem:: size_of:: <Baz >( ) , 1usize ) ;
44
+ assert_eq ! ( :: std:: mem:: align_of:: <Baz >( ) , 1usize ) ;
45
+ }
46
+ impl Clone for Baz {
47
+ fn clone ( & self ) -> Self { * self }
48
+ }
Original file line number Diff line number Diff line change
1
+ // bindgen-flags: --whitelist-type Baz
2
+
3
+ struct Bar {
4
+ const int m_baz;
5
+ Bar (int baz);
6
+ };
7
+
8
+ class Baz {
9
+ static const Bar FOO[];
10
+ };
You can’t perform that action at this time.
0 commit comments