Pre-RFC: Function parameter defaults
Rust Internals [Unofficial]
February 25, 2026
quinedot:
Conceivably if both have defaults, it could be
[fn(bool); 2]instead.
I assume the compiler would insert the default argument value at the callsite? So at an ABI level there is no such thing as defaulted args (this is how it works in C++/Itanum for example).
In that case your proposed fn(bool) wouldn't work, especially not if the functions have different default args as in your example.
The other possible lowering would be to insert hidden Option<...> around the optional argument and have the callee resolve this. But that will likely be less efficient code gen..
(To design good and performant abstractions you need to consider the target machine code you want, rather than start with lofty high level goals.)
Discussion in the ATmosphere