-
-
Notifications
You must be signed in to change notification settings - Fork 358
Closed
Description
In v3.x, it might make sense to use #[non_exhaustive] on syn's structs. As long as some kind of fn new or impl Default is provided, users would still be able to construct structs manually, while still allowing the language to evolve further.
I'm not entirely sure yet which structs should have this attribute, but I think it should basically be "all, unless a good argument is given as to why not". As an example, Abi probably shouldn't be, since it's basically a small helper struct. But ItemStruct definitely should (imagine the language wanted add unsafe struct Foo {} or extern "C" struct Foo {}).
This would have avoided the issues in #1851.
nfejzic
Metadata
Metadata
Assignees
Labels
No labels