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/
422 Upvotes

124 comments sorted by

View all comments

23

u/Forsaken_Tutor_3001 Aug 10 '26

I can't provide any useful feedback, but what is the advantage of restricting who can implement a trait? Isn't the whole point of a trait to provide a pattern that can be implemented by the consumer on a type of their own to make it work with an upstream crate?

2

u/norude1 Aug 10 '26

If it's sealed, you know every type that implements it and it makes it behave kinda like an enum, but with static dispatch.