File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -2507,17 +2507,21 @@ where
2507
2507
let extra_args = if sig. abi == RustCall {
2508
2508
assert ! ( !sig. c_variadic && extra_args. is_empty( ) ) ;
2509
2509
2510
- match sig. inputs ( ) . last ( ) . unwrap ( ) . kind {
2511
- ty:: Tuple ( tupled_arguments) => {
2510
+ if let Some ( input ) = sig. inputs ( ) . last ( ) {
2511
+ if let ty:: Tuple ( tupled_arguments) = input . kind {
2512
2512
inputs = & sig. inputs ( ) [ 0 ..sig. inputs ( ) . len ( ) - 1 ] ;
2513
2513
tupled_arguments. iter ( ) . map ( |k| k. expect_ty ( ) ) . collect ( )
2514
- }
2515
- _ => {
2514
+ } else {
2516
2515
bug ! (
2517
2516
"argument to function with \" rust-call\" ABI \
2518
- is not a tuple"
2517
+ is not a tuple"
2519
2518
) ;
2520
2519
}
2520
+ } else {
2521
+ bug ! (
2522
+ "argument to function with \" rust-call\" ABI \
2523
+ is not a tuple"
2524
+ ) ;
2521
2525
}
2522
2526
} else {
2523
2527
assert ! ( sig. c_variadic || extra_args. is_empty( ) ) ;
You can’t perform that action at this time.
0 commit comments