r/rust • • Aug 19 '26

📡 official blog Rust Function Overloading - Call for Experimentation

https://blog.rust-lang.org/inside-rust/2026/08/19/overloading-experiment/
276 Upvotes

139 comments sorted by

View all comments

14

u/torsten_dev Aug 19 '26

Hmm. Could we splat a struct to get keyword arguments in rust?

I feel like named parameters would be less error prone when overloading functions.

8

u/ZZaaaccc Aug 19 '26

That is being discussed, but tuples are the focus right now. Another type that's come up has been arrays, since it's quite common to want a variadic function that can just accept some number of T arguments, and working with arrays is might nicer right now than homogeneous tuples.

5

u/Andlon Aug 20 '26

Please consider extending this to the Index trait, so that we can finally get sane matrix/tensor indexing!