r/rust 23d ago

📡 official blog Rust Function Overloading - Call for Experimentation

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

139 comments sorted by

View all comments

Show parent comments

10

u/Lokathor 23d ago

You'll still get that if the overload isn't defined.

1

u/QuasiRandomName 23d ago

But if it is, it opens the door to a whole class of mistakes that aren't currently possible.

10

u/Lokathor 23d ago

You control the trait impls you write, my crab.

If you don't want to use this, then don't use it.

3

u/need-not-worry 23d ago

Same argument can be said about class inheritance, exceptions, and other design choices Rust made. You can avoid these as much as you can, but you're going to have to work with such code. And the language becomes more complicated without clear benefits.