ABI of a ZST in function argument position?

⚓ Rust    📅 2025-06-12    👤 surdeus    👁️ 5      

surdeus

Warning

This post was published 65 days ago. The information described in this article may have changed.

Is it guaranteed that a ZST argument has no effect on a function's ABI? For example, are the following two functions guaranteed to have the same ABI?

extern "C" {
    fn foo(a: u8, b: u16);
    fn bar(a: u8, x: (), b: u16);
}

2 posts - 2 participants

Read full topic

🏷️ rust_feed