Skip to content

Use the term struct-like variant instead of anonymous structs for data of struct-like enum variants#152530

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
orzechow:struct_like_enum_variants_docs
Apr 14, 2026
Merged

Use the term struct-like variant instead of anonymous structs for data of struct-like enum variants#152530
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
orzechow:struct_like_enum_variants_docs

Conversation

@orzechow
Copy link
Copy Markdown

The current term in the docs anonymous structs seems to be outdated.
I'd suggest struct-like data or rephrasing the whole sentence to use struct-like variant.

The terminology used in the Rust Book on enums is

named fields, like a struct

The Reference on enums uses

struct-like enum variant

The term anonymous struct on the other hand is neither mentioned in the Rust book on structs or enums, nor the references on structs or enums.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 12, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Feb 12, 2026

r? @ChrisDenton

rustbot has assigned @ChrisDenton.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from ChrisDenton, Mark-Simulacrum

@ChrisDenton
Copy link
Copy Markdown
Member

To me "struct-like data" still seems a bit jargony without it being defined.

or rephrasing the whole sentence to use struct-like variant.

I think that would be my preference if you're able to rephrase it. At least the reference (which is linked) contains that exact phrase so it should be clear what's meant.

@ChrisDenton
Copy link
Copy Markdown
Member

@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 3, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 3, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 3, 2026
@orzechow orzechow force-pushed the struct_like_enum_variants_docs branch from 84e5839 to 0b7c4dc Compare April 12, 2026 12:14
@rustbot

This comment has been minimized.

@orzechow orzechow force-pushed the struct_like_enum_variants_docs branch from 0b7c4dc to 0330663 Compare April 12, 2026 12:28
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 12, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@orzechow orzechow changed the title Use the term struct-like data instead of anonymous structs for data of struct-like enum variants Use the term struct-like variant instead of anonymous structs for data of struct-like enum variants Apr 12, 2026
@orzechow
Copy link
Copy Markdown
Author

orzechow commented Apr 12, 2026

Thanks for the review!
I changed it to struct-like variant then 👌

@rustbot ready

PS: I've replaced my first commit and rebased on top of main (following the dev guide).

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 12, 2026
@ChrisDenton
Copy link
Copy Markdown
Member

Thanks!

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 14, 2026

📌 Commit 0330663 has been approved by ChrisDenton

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Apr 14, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 14, 2026
Rollup of 3 pull requests

Successful merges:

 - #152530 (Use the term struct-like variant instead of anonymous structs for data of struct-like enum variants)
 - #155005 (preserve SIMD element type information)
 - #155230 (Avoid linting `doc_cfg` as unused in rustc)
@rust-bors rust-bors Bot merged commit 47d991a into rust-lang:main Apr 14, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 14, 2026
rust-timer added a commit that referenced this pull request Apr 14, 2026
Rollup merge of #152530 - orzechow:struct_like_enum_variants_docs, r=ChrisDenton

Use the term struct-like variant instead of anonymous structs for data of struct-like enum variants

The current term in the docs `anonymous structs` seems to be outdated.
I'd suggest `struct-like data` or rephrasing the whole sentence to use `struct-like variant`.

The terminology used in the [Rust Book on enums](https://doc.rust-lang.org/stable/book/ch06-01-defining-an-enum.html#listing-6-2) is
> named fields, like a struct

The [Reference on enums](https://doc.rust-lang.org/stable/reference/items/enumerations.html#r-items.enum.constructor) uses
> struct-like enum variant

The term `anonymous struct` on the other hand is neither mentioned in the Rust book on [structs](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html) or [enums](https://doc.rust-lang.org/stable/book/ch06-01-defining-an-enum.html#listing-6-2), nor the references on [structs](https://doc.rust-lang.org/stable/reference/items/structs.html) or [enums](https://doc.rust-lang.org/stable/reference/items/enumerations.html#r-items.enum.constructor).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants