#[non_exhaustive]'s ability to prevent downstream users from *creating* structs, enums, and enum variants looks like it could be used for new API patterns. Tricky part re: invariant enforcement is users can still replace fields if they have owned/mutable access.https://twitter.com/rustlang/status/1207693777143549953 …
-
-
Yup, that's a good point, and a trick I've used myself. Would have been more clear if I had left off "struct" from the above and made it clear it's enums that are getting new possibilities - struct #[non_exhaustive] is much more about convenience and consistency.
- End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

