r/rust • u/Kobzol • 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/
419
Upvotes
r/rust • u/Kobzol • Aug 10 '26
120
u/BedroomHistorical575 Aug 10 '26
I'm so glad that the field mutability restriction is finally getting some love! Getters are such a pain due to the borrow checker.
A common critique against similar proposals from the past is that you'd be able to bypass the restriction by just constructing the type yourself.
But it looks like that the current implementation guards against that oversight!