-
Notifications
You must be signed in to change notification settings - Fork 13k
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
deriving codegen: add intrinsic to map enum instance to its variant index #15620
Comments
This is already exposed in the |
The semantics of this intrinsic need to be consistent with whatever we decide to do for #15523 |
For my usecase, I don't really care about order, just equality, and this would let me compare token types without a very large match (that compiles to pretty poor code) and without transmuting to a fragile representation. |
do note also huon's point here: #15375 (comment) |
Should this still be open? What's the point of a variant index intrinsic? |
Due to huon's point from #15375 that the ordering (in terms of the value used for the discriminant) might change over time with changes to the compiler, plus the fact that the comments here indicate that the important thing is equality comparisons, not an ordering nor assignment to integer values, I am just going to close this. |
…kril triagebot exclude_labels -> exclude_titles rust-lang/triagebot#1720
Spawned off of #15503 (comment)
The text was updated successfully, but these errors were encountered: