Skip to content

Trans enum & tuple struct constructors in place. - #15765

Closed
luqmana wants to merge 5 commits into
rust-lang:masterfrom
luqmana:iec
Closed

Trans enum & tuple struct constructors in place.#15765
luqmana wants to merge 5 commits into
rust-lang:masterfrom
luqmana:iec

Conversation

@luqmana

@luqmana luqmana commented Jul 18, 2014

Copy link
Copy Markdown
Contributor

Fixes #15400.

@pczarn

pczarn commented Jul 18, 2014

Copy link
Copy Markdown
Contributor

@luqmana, could you elaborate? I tried implementing nested C-like enums. I lack knowledge on how to trans something like NestedCEnumVariant(FlatCEnumVariant) to a single store.

@luqmana

luqmana commented Jul 18, 2014

Copy link
Copy Markdown
Contributor Author

@pczarn Right now when you have something like let x = Some(23i) we create a function Some that takes an int and returns Option<int> and we'd do this for any type we use with Option. This pull makes it such that we don't generate all these little functions and do those function calls. Instead what it does is just construct the Option in place.

@pczarn

pczarn commented Jul 18, 2014

Copy link
Copy Markdown
Contributor

@luqmana Interesting. I see that I need an identity function that simply casts the argument. In addition to the representation check, of course.

Thanks.

bors added a commit that referenced this pull request Jul 19, 2014
@bors bors closed this Jul 19, 2014
@luqmana
luqmana deleted the iec branch August 27, 2014 17:35
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

Successfully merging this pull request may close these issues.

Inline direct calls to enum variant constructors in the frontend

4 participants