Skip to content
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

core::repr assumes it knows how enums are represented #5652

Closed
jld opened this issue Apr 1, 2013 · 1 comment
Closed

core::repr assumes it knows how enums are represented #5652

jld opened this issue Apr 1, 2013 · 1 comment

Comments

@jld
Copy link
Contributor

jld commented Apr 1, 2013

The TyVisitor impl in core::repr assumes it knows how enums are laid out, and can determine this based only on the number of variants. This will break if we want to do anything interesting with representations. In particular, this blocks #1271 (nullable pointers, which I have mostly implemented aside from this) and #1647 (smaller discriminants).

@ghost ghost assigned jld Apr 7, 2013
bors added a commit that referenced this issue Apr 15, 2013
This takes care of one of the last remnants of assumptions about enum layout.  A type visitor is now passed a function to read a value's discriminant, then accesses fields by being passed a byte offset for each one.  The latter may not be fully general, despite the constraints imposed on representations by borrowed pointers, but works for any representations currently planned and is relatively simple.

Closes #5652.
@graydon
Copy link
Contributor

graydon commented Apr 19, 2013

closed by 3809a04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants