r/rust • u/rustacean1337 • Nov 17 '22
What are Rust’s biggest weaknesses?
What would you say are Rust’s biggest weaknesses right now? And are they things that can be fixed in future versions do you think or is it something that could only be fixed by introducing a breaking change? Let’s say if you could create a Rust 2.0 and therefore not worry about backwards compatibility what would you do different.
220
Upvotes
View all comments
Show parent comment
2
u/robin-m Nov 18 '22
Some kind of delegation would totally solve the issue.
Delegation is also extremely useful to have a sane way to emulate inheritance without it’s issue. You can create a new type that encapsulate your "base class", and delegate all the function you want to it.
It’s just not as easy to design as it looks like because any use of
Selfneed to be disambiguated. Should a functionfoo, when delegated, ifFoo::foowas returningSelf, shouldWrapFoo::fooreturnFooorWrappedFoo?