Fix handling of ignored arguments in FFI wrappers for rust functions

Fixes #16441.