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> {
38013801 _ => false ,
38023802 } ;
38033803
3804- let arg_tys = if let Some ( CDeclKind :: Function { parameters, .. } ) =
3804+ let mut arg_tys = if let Some ( CDeclKind :: Function { parameters, .. } ) =
38053805 self . ast_context . function_declref_decl ( func)
38063806 {
38073807 self . ast_context . tys_of_params ( parameters)
@@ -3857,10 +3857,12 @@ impl<'c> Translation<'c> {
38573857 transmute_expr ( mk ( ) . infer_ty ( ) , target_ty, fn_ptr)
38583858 } )
38593859 }
3860- Some ( _) => {
3860+ Some ( CTypeKind :: Function ( _, ty_arg_tys, ..) ) => {
3861+ arg_tys = Some ( ty_arg_tys. clone ( ) ) ;
38613862 // Normal function pointer
38623863 callee. map ( unwrap_function_pointer)
38633864 }
3865+ Some ( _) => panic ! ( "function pointer did not point to CTYpeKind::Function: {fn_ty:?}" ) ,
38643866 }
38653867 }
38663868 } ;
You can’t perform that action at this time.
0 commit comments