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

luqmana
Copy link
Member

@luqmana luqmana commented May 2, 2016

Fixes #33202.

@rust-highfive
Copy link
Collaborator

r? @nrc

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

@nrc
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 aturon added I-nominated T-lang Relevant to the language team, which will review and decide on the PR/issue. labels May 6, 2016
@aturon
Copy link
Member

aturon commented May 6, 2016

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

@bors
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 33202-repr-ice branch 2 times, most recently from 9c47062 to a08c398 Compare May 11, 2016 17:01
@nikomatsakis
Copy link
Contributor

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
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 changed the title typeck: Don't allow invalid reprs for univariant enums. adt: Allow repr attribute on single variant enum. May 13, 2016
@luqmana
Copy link
Member Author

luqmana commented May 13, 2016

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

@nrc
Copy link
Member

nrc commented May 13, 2016

@bors: r+

@bors
Copy link
Contributor

bors commented May 13, 2016

📌 Commit f3e1d57 has been approved by nrc

@bors
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
adt: Allow repr attribute on single variant enum.

Fixes #33202.
@bors bors merged commit f3e1d57 into rust-lang:master May 13, 2016
@bluss bluss added the relnotes Marks issues that should be documented in the release notes of the next release. label May 14, 2016
@luqmana luqmana deleted the 33202-repr-ice branch May 15, 2016 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants