File tree 2 files changed +7
-11
lines changed
2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -889,14 +889,10 @@ fn cfuncty_to_rs(ctx: &mut GenCtx,
889
889
aty : & [ ( String , Type ) ] ,
890
890
var : bool ) -> ast:: FnDecl {
891
891
892
- let ret = P ( match * rty {
893
- TVoid => ast:: Ty {
894
- id : ast:: DUMMY_NODE_ID ,
895
- node : ast:: TyTup ( vec ! [ ] ) ,
896
- span : ctx. span
897
- } ,
898
- _ => cty_to_rs ( ctx, rty)
899
- } ) ;
892
+ let ret = match * rty {
893
+ TVoid => ast:: DefaultReturn ( ctx. span ) ,
894
+ _ => ast:: Return ( P ( cty_to_rs ( ctx, rty) ) )
895
+ } ;
900
896
901
897
let mut unnamed: usize = 0 ;
902
898
let args: Vec < ast:: Arg > = aty. iter ( ) . map ( |arg| {
@@ -937,7 +933,7 @@ fn cfuncty_to_rs(ctx: &mut GenCtx,
937
933
let var = !args. is_empty ( ) && var;
938
934
return ast:: FnDecl {
939
935
inputs : args,
940
- output : ast :: Return ( ret) ,
936
+ output : ret,
941
937
variadic : var
942
938
} ;
943
939
}
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ fn func_proto() {
43
43
fn with_func_ptr_arg ( ) {
44
44
assert_bind_eq ( "headers/func_with_func_ptr_arg.h" , "
45
45
extern \" C\" {
46
- pub fn foo(bar: ::std::option::Option<extern \" C\" fn() -> () >) -> ( );
46
+ pub fn foo(bar: ::std::option::Option<extern \" C\" fn()> );
47
47
}
48
48
" ) ;
49
49
}
@@ -52,7 +52,7 @@ fn with_func_ptr_arg() {
52
52
fn with_array_arg ( ) {
53
53
assert_bind_eq ( "headers/func_with_array_arg.h" , "
54
54
extern \" C\" {
55
- pub fn f(x: *mut ::libc::c_int) -> () ;
55
+ pub fn f(x: *mut ::libc::c_int);
56
56
}
57
57
" ) ;
58
58
}
You can’t perform that action at this time.
0 commit comments