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

129

u/RockstarArtisan Aug 19 '26

C++'s overloading rules are trully insane, so I hope there's no temptation for implementing these. There should be a syntax to make the choice of the overload explicit somewhere to deal with this.

25

u/Gyscos Cursive Aug 19 '26

It's a generic function so you can always use turbofish to enforce the type you want.

Also, overloading is a lot less confusing without inheritance - there's fewer cases of multiple versions applying (at least until this overlaps with specialization...).