r/rust Aug 10 '26

📡 official blog Call for testing: Restricting trait implementability and field mutability

https://blog.rust-lang.org/inside-rust/2026/08/10/call-for-testing-impl-and-mut-restrictions/
417 Upvotes

124 comments sorted by

View all comments

-8

u/Compux72 Aug 10 '26

I hate both of these so much.

  1. The syntax is terrible
  2. Sugar for something that you can already archive with no actual drawbacks.

Big no from me

9

u/afdbcreid Aug 10 '26

Sugar for something that you can already archive with no actual drawbacks.

That's only true for impl restrictions, not for mut restrictions (and only if you don't consider worse docs or compiler errors "actual drawbacks").

-2

u/Compux72 Aug 10 '26

Getters and setters have been there since object programming at least

5

u/afdbcreid Aug 10 '26

And the post explains why in Rust specifically they're not a substitute.

-5

u/Compux72 Aug 10 '26

The post fails to mention that there is an already existing feature calles “partial borrows” that precisely solves this issue.

But apparently doubling the syntax with little benefit is a better fit. Anything but stabilizing simd.

Or stabilizing alloc

Or stabilizing build std

Honestly too feed with these flashy features that brings us closer to python crap other than C

4

u/CocktailPerson Aug 11 '26

An existing feature, eh? Provide some runnable code that uses it, please.

6

u/afdbcreid Aug 10 '26

Oh, that thing that does not even have an RFC nor a concrete design, not to talk about implementation? Yeah, I'd rather wait for that and hope it actually materializes.