about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorJed Davis <jld@panix.com>2013-01-07 03:42:49 -0800
committerJed Davis <jld@panix.com>2013-02-09 22:28:43 -0800
commit3742b62f64c8b2a01457b70ee37d3dc167a86a07 (patch)
tree565502e6c3c58ac189e975f1a684d620bfe2f769 /src/libsyntax
parent9d7014e55c06a184b02ccf724497c4c72d4d2041 (diff)
downloadrust-3742b62f64c8b2a01457b70ee37d3dc167a86a07.tar.gz
rust-3742b62f64c8b2a01457b70ee37d3dc167a86a07.zip
Omit discriminant from nullary univariant enums.
If an enum is isomorphic to unit, there's no need to use any bits to
represent it.  The only obvious reason this wasn't the case was because
the enum could be C-like and have a user-specified discriminant -- but
that value is constant, so it doesn't need to be stored.

This change means that all newtype-like enums have the same size (and
layout) as their underlying type, which might be a useful property to
have, at least in terms of making programs' low-level behavior less
surprising.
Diffstat (limited to 'src/libsyntax')
0 files changed, 0 insertions, 0 deletions