File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
c2rust-transpile/src/translator Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3801,7 +3801,7 @@ impl<'c> Translation<'c> {
3801
3801
_ => false ,
3802
3802
} ;
3803
3803
3804
- let arg_tys = if let Some ( CDeclKind :: Function { parameters, .. } ) =
3804
+ let mut arg_tys = if let Some ( CDeclKind :: Function { parameters, .. } ) =
3805
3805
self . ast_context . function_declref_decl ( func)
3806
3806
{
3807
3807
self . ast_context . tys_of_params ( parameters)
@@ -3857,10 +3857,12 @@ impl<'c> Translation<'c> {
3857
3857
transmute_expr ( mk ( ) . infer_ty ( ) , target_ty, fn_ptr)
3858
3858
} )
3859
3859
}
3860
- Some ( _) => {
3860
+ Some ( CTypeKind :: Function ( _, ty_arg_tys, ..) ) => {
3861
+ arg_tys = Some ( ty_arg_tys. clone ( ) ) ;
3861
3862
// Normal function pointer
3862
3863
callee. map ( unwrap_function_pointer)
3863
3864
}
3865
+ Some ( _) => panic ! ( "function pointer did not point to CTYpeKind::Function: {fn_ty:?}" ) ,
3864
3866
}
3865
3867
}
3866
3868
} ;
You can’t perform that action at this time.
0 commit comments