File tree 3 files changed +61
-1
lines changed
3 files changed +61
-1
lines changed Original file line number Diff line number Diff line change @@ -588,7 +588,20 @@ impl Type {
588
588
589
589
let kind = match ty_kind {
590
590
CXType_Unexposed if * ty != canonical_ty &&
591
- canonical_ty. kind ( ) != CXType_Invalid => {
591
+ canonical_ty. kind ( ) != CXType_Invalid &&
592
+ // Sometime clang desugars some types more than
593
+ // what we need, specially with function
594
+ // pointers.
595
+ //
596
+ // We should also try the solution of inverting
597
+ // those checks instead of doing this, that is,
598
+ // something like:
599
+ //
600
+ // CXType_Unexposed if ty.ret_type().is_some()
601
+ // => { ... }
602
+ //
603
+ // etc.
604
+ !canonical_ty. spelling ( ) . contains ( "type-parameter" ) => {
592
605
debug ! ( "Looking for canonical type: {:?}" , canonical_ty) ;
593
606
return Self :: from_clang_ty ( potential_id,
594
607
& canonical_ty,
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 , Clone ) ]
9
+ pub struct Foo < T > {
10
+ pub _address : u8 ,
11
+ pub _phantom_0 : :: std:: marker:: PhantomData < T > ,
12
+ }
13
+ pub type Foo_FunctionPtr < T > =
14
+ :: std:: option:: Option < unsafe extern "C" fn ( ) -> T > ;
15
+ #[ repr( C ) ]
16
+ #[ derive( Debug , Copy , Clone ) ]
17
+ pub struct RefPtr < T > {
18
+ pub _address : u8 ,
19
+ pub _phantom_0 : :: std:: marker:: PhantomData < T > ,
20
+ }
21
+ #[ repr( C ) ]
22
+ #[ derive( Debug , Copy , Clone ) ]
23
+ pub struct RefPtr_Proxy < T , R , Args > {
24
+ pub _address : u8 ,
25
+ pub _phantom_0 : :: std:: marker:: PhantomData < T > ,
26
+ pub _phantom_1 : :: std:: marker:: PhantomData < R > ,
27
+ pub _phantom_2 : :: std:: marker:: PhantomData < Args > ,
28
+ }
29
+ pub type RefPtr_Proxy_member_function < R , Args > =
30
+ :: std:: option:: Option < unsafe extern "C" fn ( arg1 : Args ) -> R > ;
31
+ pub type Returner < T > = :: std:: option:: Option < unsafe extern "C" fn ( ) -> T > ;
Original file line number Diff line number Diff line change
1
+ template <typename T>
2
+ class Foo
3
+ {
4
+ typedef T (FunctionPtr)();
5
+ };
6
+
7
+ template <typename T>
8
+ class RefPtr {
9
+ template <typename R, typename ... Args>
10
+ class Proxy {
11
+ typedef R (T::*member_function)(Args...);
12
+ };
13
+ };
14
+
15
+ template <typename T>
16
+ using Returner = T(*)();
You can’t perform that action at this time.
0 commit comments