Skip to content

Rephrase and expand empty_enum documentation. #12833

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

Merged
merged 1 commit into from
May 23, 2024

Conversation

kpreid
Copy link
Contributor

@kpreid kpreid commented May 23, 2024

  • Remove incorrect claim that “wrappers around it are the conventional way to define an uninhabited type”.
  • Discuss why one would use !, a newtype struct, or keep the enum.
  • Add links to relevant documentation.

Before writing this change, I asked the community via IRLO and Zulip for feedback. The broad consensus seemed to me to be that in a world where both never_type and min_exhaustive_patterns are stable and therefore available for general use, we might want to ! or newtypes of it — but it's certainly not “conventional” yet. Therefore, I've removed “conventional” and added a discussion of the pros and cons of different choices.

changelog: [empty_enum]: expanded documentation

* Remove incorrect claim that “wrappers around it are the conventional
  way to define an uninhabited type”.
* Discuss why one would use `!`, a newtype struct, or keep the enum.
* Add links to relevant documentation.
@rustbot
Copy link
Collaborator

rustbot commented May 23, 2024

r? @Manishearth

rustbot has assigned @Manishearth.
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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 23, 2024
@Manishearth
Copy link
Member

@bors r+

thanks!

@bors
Copy link
Contributor

bors commented May 23, 2024

📌 Commit cfa150b has been approved by Manishearth

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 23, 2024

⌛ Testing commit cfa150b with merge 76856ff...

@bors
Copy link
Contributor

bors commented May 23, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 76856ff to master...

@bors bors merged commit 76856ff into rust-lang:master May 23, 2024
5 checks passed
@kpreid kpreid deleted the empty-enum-doc branch May 23, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants