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

Consider some form of extensible enums #409

Open
zwarich opened this issue Oct 24, 2014 · 3 comments
Open

Consider some form of extensible enums #409

zwarich opened this issue Oct 24, 2014 · 3 comments
Labels
A-data-types RFCs about data-types A-enum Enum related proposals & ideas A-sum-types Sum types related proposals. A-typesystem Type system related proposals & ideas postponed RFCs that have been postponed and may be revisited at a later time. T-lang Relevant to the language team, which will review and decide on the RFC.

Comments

@zwarich
Copy link

zwarich commented Oct 24, 2014

There are a number of different approaches to making enums more extensible, e.g. extensible sum types, polymorphic variants, and union types. We should survey the landscape of ideas and find one that works best in the context of Rust.

Any concrete proposal should include details of the type system changes (including interaction with other type system features) and in-memory data representation.

@zwarich zwarich added the postponed RFCs that have been postponed and may be revisited at a later time. label Oct 24, 2014
@reem
Copy link

reem commented Dec 15, 2014

My take 2 of the original RFC (#402) which addresses many of the issues of the original by stripping most crazy features and adding detailed memory representation and compilation strategy sections: https://github.com/reem/rfcs/blob/join-types/text/0000-join-types.md

Comments desired and very welcome.

@petrochenkov petrochenkov added the T-lang Relevant to the language team, which will review and decide on the RFC. label Jan 19, 2018
@xfoxfu
Copy link

xfoxfu commented Oct 14, 2018

Four years has passed and now Rust has reached 1.0 by long ago. Is there any possibility to discuss union types again? If RFC passed and possible, I'd like to work on the implementation.

@Centril Centril added A-data-types RFCs about data-types A-typesystem Type system related proposals & ideas A-enum Enum related proposals & ideas A-sum-types Sum types related proposals. labels Nov 27, 2018
@jonas-schievink
Copy link
Contributor

Status update: We have unions now!

(also see RFC 2008, which introduces the #[non_exhaustive] attribute, also referred to as "extensible enums")

wycats pushed a commit to wycats/rust-rfcs that referenced this issue Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-data-types RFCs about data-types A-enum Enum related proposals & ideas A-sum-types Sum types related proposals. A-typesystem Type system related proposals & ideas postponed RFCs that have been postponed and may be revisited at a later time. T-lang Relevant to the language team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

6 participants