Skip to content

Allow #[repr(i32)] for univariant enum - #31232

Merged
bors merged 1 commit into
rust-lang:masterfrom
stepancheg:enum-univariant
Feb 1, 2016
Merged

bors merged 1 commit into
rust-lang:masterfrom
stepancheg:enum-univariant

Conversation

@stepancheg

Copy link
Copy Markdown
Contributor
#[repr(i32)]
enum Univariant {
    X = 17
}

Fixes #10292

```
#[repr(i32)]
enum Univariant {
    X = 17
}
```

Fixes rust-lang#10292
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @nrc

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove E0083 along with this change

@nrc

nrc commented Jan 27, 2016

Copy link
Copy Markdown
Member

I am amazed this worked without changes to trans. cc @rust-lang/compiler and @luqmana

r+ if no one objects and with the error description removed.

@stepancheg

Copy link
Copy Markdown
Contributor Author

Removed E0083.

@retep998

Copy link
Copy Markdown
Contributor

Why was this ever illegal in the first place? It makes no sense to me.

@luqmana

luqmana commented Jan 27, 2016

Copy link
Copy Markdown
Contributor

Yea, looks good to me. Not sure why it was disallowed but should be fine if it builds and passes tests.

Comment thread src/librustc_typeck/check/mod.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vs.is_empty()

@stepancheg

Copy link
Copy Markdown
Contributor Author

Updated with is_empty().

@nagisa

nagisa commented Jan 27, 2016

Copy link
Copy Markdown
Member

No objections.

@Aatch

Aatch commented Jan 29, 2016

Copy link
Copy Markdown
Contributor

The reason this doesn't require any trans changes is because the check for C-Like enum happens before the check for single-variant.

@nrc

nrc commented Feb 1, 2016

Copy link
Copy Markdown
Member

Thanks all! (And especially @stepancheg for the PR in the first place and some patience for the r+).

@bors: r+

@bors

bors commented Feb 1, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 641267e has been approved by nrc

@bors

bors commented Feb 1, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 641267e with merge 14dc9fc...

bors added a commit that referenced this pull request Feb 1, 2016
```
enum Univariant {
    X = 17
}
```

Fixes #10292
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.

9 participants