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

Rename C-like enum to Field-less enum #46187

Merged
merged 6 commits into from
Dec 7, 2017
Merged

Conversation

notriddle
Copy link
Contributor

There is no need to reference the C programming language to explain this concept.

There is no need to reference the C programming language to explain this concept.
@rust-highfive
Copy link
Collaborator

r? @alexcrichton

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

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Nov 22, 2017
@kennytm
Copy link
Member

kennytm commented Nov 22, 2017

Context: https://internals.rust-lang.org/t/proposal-bikeshed-rename-c-like-enumeration/6209

Randomly reassigning to someone in the docs team… r? @frewsxcv

@steveklabnik
Copy link
Member

Until the decisions is made, we can't accept this PR.

@QuietMisdreavus
Copy link
Member

Pending discussion on #46348 from lang team, i'm reopening this PR.

@kennytm kennytm added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). T-lang Relevant to the language team, which will review and decide on the PR/issue. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Nov 28, 2017
@kennytm
Copy link
Member

kennytm commented Dec 6, 2017

Randomly reassigning to member on the lang team… r? @cramertj

GitHub doesn't accept it, reassigning… r? @nikomatsakis

@kennytm kennytm assigned nikomatsakis and unassigned frewsxcv Dec 6, 2017
Copy link
Member

@QuietMisdreavus QuietMisdreavus left a comment

Choose a reason for hiding this comment

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

The lang team (via @withoutboats) has given a quiet assent for this change, so i'll take it over from a docs perspective.

@@ -1641,13 +1641,13 @@ impl Foo {
These attributes do not work on typedefs, since typedefs are just aliases.

Representations like `#[repr(u8)]`, `#[repr(i64)]` are for selecting the
discriminant size for C-like enums (when there is no associated data, e.g.
discriminant size for enums with no data fields on any of the variants, e.g.
`enum Color {Red, Blue, Green}`), effectively setting the size of the enum to
Copy link
Member

Choose a reason for hiding this comment

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

You took out the opening parenthesis, but left the closing one here (after "enum Color").

`enum Color {Red, Blue, Green}`), effectively setting the size of the enum to
the size of the provided type. Such an enum can be cast to a value of the same
type as well. In short, `#[repr(u8)]` makes the enum behave like an integer
with a constrained set of allowed values.

Only C-like enums can be cast to numerical primitives, so this attribute will
Only field-less enums can be cast to numerical primitives, so this attribute will
Copy link
Member

Choose a reason for hiding this comment

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

This line is longer than 80 characters, which caused the build to fail on travis.

@notriddle
Copy link
Contributor Author

Fixed both.

@kennytm kennytm added A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Dec 6, 2017
@kennytm kennytm removed the S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). label Dec 6, 2017
@QuietMisdreavus
Copy link
Member

Excellent! Thanks so much!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 6, 2017

📌 Commit a126a73 has been approved by QuietMisdreavus

@bors
Copy link
Contributor

bors commented Dec 7, 2017

⌛ Testing commit a126a73 with merge 7b637b7...

bors added a commit that referenced this pull request Dec 7, 2017
Rename C-like enum to Field-less enum

There is no need to reference the C programming language to explain this concept.
@kennytm kennytm added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 7, 2017
@bors
Copy link
Contributor

bors commented Dec 7, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: QuietMisdreavus
Pushing 7b637b7 to master...

@bors bors merged commit a126a73 into rust-lang:master Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants