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 @@ -955,14 +955,10 @@ fn cfuncty_to_rs(ctx: &mut GenCtx,
955
955
aty : & [ ( String , Type ) ] ,
956
956
var : bool ) -> ast:: FnDecl {
957
957
958
- let ret = P ( match * rty {
959
- TVoid => ast:: Ty {
960
- id : ast:: DUMMY_NODE_ID ,
961
- node : ast:: TyTup ( vec ! [ ] ) ,
962
- span : ctx. span
963
- } ,
964
- _ => cty_to_rs ( ctx, rty)
965
- } ) ;
958
+ let ret = match * rty {
959
+ TVoid => ast:: DefaultReturn ( ctx. span ) ,
960
+ _ => ast:: Return ( P ( cty_to_rs ( ctx, rty) ) )
961
+ } ;
966
962
967
963
let mut unnamed: usize = 0 ;
968
964
let args: Vec < ast:: Arg > = aty. iter ( ) . map ( |arg| {
@@ -1003,7 +999,7 @@ fn cfuncty_to_rs(ctx: &mut GenCtx,
1003
999
let var = !args. is_empty ( ) && var;
1004
1000
return ast:: FnDecl {
1005
1001
inputs : args,
1006
- output : ast :: Return ( ret) ,
1002
+ output : ret,
1007
1003
variadic : var
1008
1004
} ;
1009
1005
}
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