File tree 2 files changed +6
-8
lines changed
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -2869,7 +2869,7 @@ impl TryToRustTy for FunctionSig {
2869
2869
2870
2870
let fnty = ast:: TyKind :: BareFn ( P ( ast:: BareFnTy {
2871
2871
unsafety : ast:: Unsafety :: Unsafe ,
2872
- abi : self . abi ( ) . expect ( "Invalid abi for function!" ) ,
2872
+ abi : self . abi ( ) . expect ( "Invalid or unknown ABI for function!" ) ,
2873
2873
lifetimes : vec ! [ ] ,
2874
2874
decl : decl,
2875
2875
} ) ) ;
@@ -2950,7 +2950,7 @@ impl CodeGenerator for Function {
2950
2950
} ;
2951
2951
2952
2952
let item = ForeignModBuilder :: new ( signature. abi ( )
2953
- . expect ( "Invalid abi for function!" ) )
2953
+ . expect ( "Invalid or unknown ABI for function!" ) )
2954
2954
. with_foreign_item ( foreign_item)
2955
2955
. build ( ctx) ;
2956
2956
Original file line number Diff line number Diff line change @@ -105,8 +105,7 @@ fn get_abi(cc: CXCallingConv) -> Option<abi::Abi> {
105
105
CXCallingConv_X86FastCall => Some ( abi:: Abi :: Fastcall ) ,
106
106
CXCallingConv_AAPCS => Some ( abi:: Abi :: Aapcs ) ,
107
107
CXCallingConv_X86_64Win64 => Some ( abi:: Abi :: Win64 ) ,
108
- CXCallingConv_Invalid => None ,
109
- other => panic ! ( "unsupported calling convention: {:?}" , other) ,
108
+ _ => None ,
110
109
}
111
110
}
112
111
@@ -297,12 +296,11 @@ impl FunctionSig {
297
296
try!( ty. ret_type ( ) . ok_or ( ParseError :: Continue ) )
298
297
} ;
299
298
let ret = Item :: from_ty_or_ref ( ty_ret_type, cursor, None , ctx) ;
300
- let abi = get_abi ( ty. call_conv ( ) ) ;
299
+ let call_conv = ty. call_conv ( ) ;
300
+ let abi = get_abi ( call_conv) ;
301
301
302
302
if abi. is_none ( ) {
303
- assert ! ( cursor. kind( ) == CXCursor_ObjCInstanceMethodDecl ||
304
- cursor. kind( ) == CXCursor_ObjCClassMethodDecl ,
305
- "Invalid ABI for function signature" )
303
+ warn ! ( "Unknown calling convention: {:?}" , call_conv) ;
306
304
}
307
305
308
306
Ok ( Self :: new ( ret, args, ty. is_variadic ( ) , abi) )
You can’t perform that action at this time.
0 commit comments