-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal for C-like nested enums to become scalar data types #331
Conversation
This is related to the various proposals for efficient inheritance, in particular #245. I would very much like a general system for nested enums (whether or not we use this as a basis for efficient inheritance) and if we do that then I would not like to see something like this which does a subset of that in a different way. However, we could (and probably should) adapt the proposal here for C-like nested enums to become scalar data. |
@nick29581 I don't think anything in this proposal is necessarily related to inheritance. Perhaps the word "nested" is inappropriate, these are transitively C-like enums. |
Enum templates seem to fall out of the scope of this proposal, which is not good given the ubiquity of |
Thanks for the RFC. We discussed this in the triage meeting and decided that while it was something that might be useful, it's not something that needs to be done for 1.0, since it is backwards compatible. Furthermore, this sort of precise layout control is related to "bit data" proposals like #327 (also postponed #346) so we would like to consider these features in a unified way. That said, it appears there is only one "real" language changes here: allowing explicit C-like discriminants in enums with data. The layout optimisations is actually something we can do implicitly now since the layout of enums is undefined, that is to say, if we have If you were to tune your patch to just do this (i.e. no language changes or external user control, for now), it may be landed and would not require an RFC. However, it is relatively complicated trans code, so you may wish to open a discuss post and solicit feedback from people like @luqmana and @nikomatsakis before putting effort into the code. (cc #347) |
Remove obsolete comment in join_all() docs.
Deprecate Globals Resolver
Implementation. Works for simple enums, but otherwise untested
CLICKME for richness