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

adt: Allow repr attribute on single variant enum. #33355

Merged
merged 1 commit into from May 13, 2016

Conversation

Projects
None yet
7 participants
@luqmana
Copy link
Member

luqmana commented May 2, 2016

Fixes #33202.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented May 2, 2016

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

@nrc

This comment has been minimized.

Copy link
Member

nrc commented May 2, 2016

Why can't we let repr override the behaviour of single variant structs having no discriminant? That seems more user-friendly than having an error here.

cc @rust-lang/lang

@aturon

This comment has been minimized.

Copy link
Member

aturon commented May 6, 2016

Nominating for discussion at the next meeting, if we don't reach consensus before then.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented May 11, 2016

☔️ The latest upstream changes (presumably #33425) made this pull request unmergeable. Please resolve the merge conflicts.

@luqmana luqmana force-pushed the luqmana:33202-repr-ice branch 2 times, most recently from 9c47062 to a08c398 May 11, 2016

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented May 12, 2016

Discussed in @rust-lang/lang meeting. I think we all agree it seems like permitting this annotation might be nice, but if it's awkward to implement, than an error is fine too. @luqmana what say you?

@luqmana

This comment has been minimized.

Copy link
Member Author

luqmana commented May 12, 2016

@nikomatsakis Ok, I made it an error because there was an asset in trans to that effect. I can change it to allow this.

@luqmana luqmana force-pushed the luqmana:33202-repr-ice branch from a08c398 to b556daa May 13, 2016

@luqmana luqmana changed the title typeck: Don't allow invalid reprs for univariant enums. adt: Allow repr attribute on single variant enum. May 13, 2016

@luqmana luqmana force-pushed the luqmana:33202-repr-ice branch from b556daa to f3e1d57 May 13, 2016

@luqmana

This comment has been minimized.

Copy link
Member Author

luqmana commented May 13, 2016

Ok, updated trans::adt to allow such cases.

@nrc

This comment has been minimized.

Copy link
Member

nrc commented May 13, 2016

@bors: r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented May 13, 2016

📌 Commit f3e1d57 has been approved by nrc

@bors

This comment has been minimized.

Copy link
Contributor

bors commented May 13, 2016

⌛️ Testing commit f3e1d57 with merge 33a5c9d...

bors added a commit that referenced this pull request May 13, 2016

Auto merge of #33355 - luqmana:33202-repr-ice, r=nrc
adt: Allow repr attribute on single variant enum.

Fixes #33202.

@bors bors merged commit f3e1d57 into rust-lang:master May 13, 2016

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
homu Test successful
Details

@bluss bluss added the relnotes label May 14, 2016

@luqmana luqmana deleted the luqmana:33202-repr-ice branch May 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.