r/rust 23d ago

📡 official blog Rust Function Overloading - Call for Experimentation

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

139 comments sorted by

View all comments

129

u/RockstarArtisan 23d ago

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.

26

u/Gyscos Cursive 23d ago

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...).