-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking Issue for enum_as_repr #86772
Comments
In this blog post author mentions a problem about optimizing by specialization doesn't cover wrapper types so wrapper types aren't truly zero cost. Can trait Sorry if it is discussed before, I didn't read all of threads related to this. |
That's an interesting thought! There have been three iterations of this feature:
Possibly |
The implementation of this feature never ended up being merged. I'll close the tracking issue since it isn't currently tracking anything, but we can reopen (or open a different one) if someone picks this work back up. |
Feature gate:
#![feature(enum_as_repr)]
This is a tracking issue for traits to convert primitive enums into their repr (
core::enums::AsRepr
), and attempt to convert reprs into primitive enums (core::enums::FromRepr
).AsRepr
is automatically implemented for all relevant enum types, as well asstd::mem::Discriminant
, andFromRepr
may be derived.Public API
Steps / History
Unresolved Questions
FromRepr
forDiscriminant<T>
? We want to consider carefully if that impl would have unwanted semver implications.The text was updated successfully, but these errors were encountered: