Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
You can't even create a non-jargon alias for it because aliases don't support existential types.
-
Yeah, that is what interfaces are there for. They just happen to be called traits in Rust...
-
@Oktokolo The ability to do this isn't new, only previously this required a generic which meant that the trait bounds were defined separately from the sole variable they were applied to.
Anyway the feature isn't new either, I'm just ranting about how it adds even more jargon in an already very divergent language. -
Wait I dont get it
Youre just using a generic/template with a constraint on the type, right? Thats how I understand rust handles it.
Or using dyn you have runtime checking, similar to virtual+inheritance in C++ I guess. -
@lorentz Literally the most needless flaw of Rust is that it renames well-known things for no fuckin purpose other than to make it harder for devs to get into Rust. Elitism and ego are everywhere i guess.
Related Rants
Hey guys, did you know that you can use `impl Trait` in the position of an argument in Rust to identify an argument with its capabilities without the boilerplate of a generic parameter?
With that in mind, I present to you Rust's universal type:
rant
auxiliary incentive
universal type
rust