File tree 2 files changed +32
-2
lines changed
2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,12 @@ impl Type {
45
45
TypeKind :: AnonymousUnion ( ) => todo ! ( "strip_constraints for anonymous union" ) ,
46
46
TypeKind :: AnonymousEnum ( _) => ( ) ,
47
47
TypeKind :: FixedArray ( fixed_array) => fixed_array. inner . strip_constraints ( ) ,
48
- TypeKind :: FuncPtr ( _) => todo ! ( "strip_constraints for function pointer" ) ,
48
+ TypeKind :: FuncPtr ( func) => {
49
+ for param in func. params . required . iter_mut ( ) {
50
+ param. ty . strip_constraints ( ) ;
51
+ }
52
+ func. return_type . strip_constraints ( ) ;
53
+ }
49
54
TypeKind :: Enum ( _, _) => ( ) ,
50
55
TypeKind :: Structure ( _, _, parameters) => {
51
56
for parameter in parameters {
Original file line number Diff line number Diff line change @@ -69,7 +69,32 @@ impl<'a> PolyRecipeResolver<'a> {
69
69
} ) )
70
70
. at ( ty. source )
71
71
}
72
- asg:: TypeKind :: FuncPtr ( _) => todo ! ( ) ,
72
+ asg:: TypeKind :: FuncPtr ( func) => {
73
+ let required = func
74
+ . params
75
+ . required
76
+ . iter ( )
77
+ . map ( |param| {
78
+ self . resolve_type ( & param. ty ) . and_then ( |ty| {
79
+ Ok ( asg:: Param {
80
+ name : param. name . clone ( ) ,
81
+ ty,
82
+ } )
83
+ } )
84
+ } )
85
+ . collect :: < Result < Vec < _ > , _ > > ( ) ?;
86
+
87
+ let return_type = self . resolve_type ( & func. return_type ) ?;
88
+
89
+ asg:: TypeKind :: FuncPtr ( asg:: FuncPtr {
90
+ params : asg:: Params {
91
+ required,
92
+ is_cstyle_vararg : func. params . is_cstyle_vararg ,
93
+ } ,
94
+ return_type : Box :: new ( return_type) ,
95
+ } )
96
+ . at ( ty. source )
97
+ }
73
98
asg:: TypeKind :: Enum ( _, _) => ty. clone ( ) ,
74
99
asg:: TypeKind :: Structure ( human_name, struct_ref, poly_args) => {
75
100
let args = poly_args
You can’t perform that action at this time.
0 commit comments