rewrite never type documentation - #158370
Open
WaffleLapkin wants to merge 1 commit into
Open
Conversation
This was referenced Jun 24, 2026
Merged
kpreid
reviewed
Jun 25, 2026
mkrasnitski
reviewed
Jun 27, 2026
Contributor
There was a problem hiding this comment.
Due to the slightly messy diff, I ended up splitting my review up into many small comments, so apologies for the large number of them. Most are copy-edits, with a couple small content changes here and there. Feel free to use them or not as you see fit.
Comment on lines
+67
to
+68
| /// `!` is the canonical uninhabited type. `!` represents the type of diverging computations -- | ||
| /// computations which never resolve to any value. |
Contributor
There was a problem hiding this comment.
Suggested change
| /// `!` is the canonical uninhabited type. `!` represents the type of diverging computations -- | |
| /// computations which never resolve to any value. | |
| /// `!` represents the type of diverging computations -- computations which never resolve to any | |
| /// value. It is the canonical uninhabited type. |
Comment on lines
+77
to
+78
| /// Similarly, [`return`], [`break`], [`continue`], [`become`], and infinite [`loop`] expressions | ||
| /// all have type `!`, as the code following them is unreachable. |
Contributor
There was a problem hiding this comment.
Should become be included here if it is still unstable?
WaffleLapkin
commented
Jun 30, 2026
WaffleLapkin
force-pushed
the
never-scratch-docs
branch
from
June 30, 2026 09:10
f2dc120 to
cd5b51c
Compare
WaffleLapkin
commented
Jun 30, 2026
This comment has been minimized.
This comment has been minimized.
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 24, 2026
… r=JonathanBrouwer stabilize never type ### This PR - stabilizes the [never type](https://doc.rust-lang.org/stable/std/primitive.never.html) (aka `!`) (!!!) - sets the [never type fallback](https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html) to `!` on all editions (breaking change, see [crater report analysis](rust-lang#155499 (comment)) and [refresher on never type fallback](rust-lang#155499 (comment))) - makes `Infallible` an alias to `!` - removes `dependency_on_unit_never_type_fallback` lint (there is no more never type fallback to `()` so this lint can't be triggered) ### Cat <img width="1024" height="683" alt="52270233795_5979a3174d_b" src="https://github.com/user-attachments/assets/f6b4737e-32ef-4c33-86b2-76b81673cf20" /> ### Tracking - rust-lang#35121 - rust-lang#148922 ### FCPs - rust-lang#123508 (comment) (stabilization plan, T-lang) - rust-lang#155499 (comment) (never type stabilization modulo bugs, T-lang) - rust-lang#155924 (comment) (make `Infallible = !`, T-libs) ### Related changes - Lint bump: rust-lang#141937 - Rust 2024 edition change: - rust-lang#123748 - rust-lang#123508 - Various changes to lessen the effect of the breaking changes: - rust-lang#157820 - rust-lang#156047 - rust-lang#160705 - Never type documentation changes: rust-lang#158370 (blocked on this pr) ### Experiments - Fallback change and never type stabilization: - Run: rust-lang#155499 (comment) - Analysis: rust-lang#155499 (comment) - Status of backports: rust-lang#155499 (comment) - Fallback change, never type stabilization and making `Infallible = !`: rust-lang#155500 - Fallback change, never type stabilization, making `Infallible = !`, and removing reservation impl: rust-lang#155501 - Never type stabilization and `Infallible = !` change, _without_ fallback change: rust-lang#155657 --- Closes rust-lang#35121 Closes rust-lang#148922
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 24, 2026
… r=JonathanBrouwer stabilize never type ### This PR - stabilizes the [never type](https://doc.rust-lang.org/stable/std/primitive.never.html) (aka `!`) (!!!) - sets the [never type fallback](https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html) to `!` on all editions (breaking change, see [crater report analysis](rust-lang#155499 (comment)) and [refresher on never type fallback](rust-lang#155499 (comment))) - makes `Infallible` an alias to `!` - removes `dependency_on_unit_never_type_fallback` lint (there is no more never type fallback to `()` so this lint can't be triggered) ### Cat <img width="1024" height="683" alt="52270233795_5979a3174d_b" src="https://github.com/user-attachments/assets/f6b4737e-32ef-4c33-86b2-76b81673cf20" /> ### Tracking - rust-lang#35121 - rust-lang#148922 ### FCPs - rust-lang#123508 (comment) (stabilization plan, T-lang) - rust-lang#155499 (comment) (never type stabilization modulo bugs, T-lang) - rust-lang#155924 (comment) (make `Infallible = !`, T-libs) ### Related changes - Lint bump: rust-lang#141937 - Rust 2024 edition change: - rust-lang#123748 - rust-lang#123508 - Various changes to lessen the effect of the breaking changes: - rust-lang#157820 - rust-lang#156047 - rust-lang#160705 - Never type documentation changes: rust-lang#158370 (blocked on this pr) ### Experiments - Fallback change and never type stabilization: - Run: rust-lang#155499 (comment) - Analysis: rust-lang#155499 (comment) - Status of backports: rust-lang#155499 (comment) - Fallback change, never type stabilization and making `Infallible = !`: rust-lang#155500 - Fallback change, never type stabilization, making `Infallible = !`, and removing reservation impl: rust-lang#155501 - Never type stabilization and `Infallible = !` change, _without_ fallback change: rust-lang#155657 --- Closes rust-lang#35121 Closes rust-lang#148922
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 24, 2026
… r=JonathanBrouwer stabilize never type ### This PR - stabilizes the [never type](https://doc.rust-lang.org/stable/std/primitive.never.html) (aka `!`) (!!!) - sets the [never type fallback](https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html) to `!` on all editions (breaking change, see [crater report analysis](rust-lang#155499 (comment)) and [refresher on never type fallback](rust-lang#155499 (comment))) - makes `Infallible` an alias to `!` - removes `dependency_on_unit_never_type_fallback` lint (there is no more never type fallback to `()` so this lint can't be triggered) ### Cat <img width="1024" height="683" alt="52270233795_5979a3174d_b" src="https://github.com/user-attachments/assets/f6b4737e-32ef-4c33-86b2-76b81673cf20" /> ### Tracking - rust-lang#35121 - rust-lang#148922 ### FCPs - rust-lang#123508 (comment) (stabilization plan, T-lang) - rust-lang#155499 (comment) (never type stabilization modulo bugs, T-lang) - rust-lang#155924 (comment) (make `Infallible = !`, T-libs) ### Related changes - Lint bump: rust-lang#141937 - Rust 2024 edition change: - rust-lang#123748 - rust-lang#123508 - Various changes to lessen the effect of the breaking changes: - rust-lang#157820 - rust-lang#156047 - rust-lang#160705 - Never type documentation changes: rust-lang#158370 (blocked on this pr) ### Experiments - Fallback change and never type stabilization: - Run: rust-lang#155499 (comment) - Analysis: rust-lang#155499 (comment) - Status of backports: rust-lang#155499 (comment) - Fallback change, never type stabilization and making `Infallible = !`: rust-lang#155500 - Fallback change, never type stabilization, making `Infallible = !`, and removing reservation impl: rust-lang#155501 - Never type stabilization and `Infallible = !` change, _without_ fallback change: rust-lang#155657 --- Closes rust-lang#35121 Closes rust-lang#148922
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 24, 2026
…Brouwer stabilize never type ### This PR - stabilizes the [never type](https://doc.rust-lang.org/stable/std/primitive.never.html) (aka `!`) (!!!) - sets the [never type fallback](https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html) to `!` on all editions (breaking change, see [crater report analysis](#155499 (comment)) and [refresher on never type fallback](#155499 (comment))) - makes `Infallible` an alias to `!` - removes `dependency_on_unit_never_type_fallback` lint (there is no more never type fallback to `()` so this lint can't be triggered) ### Cat <img width="1024" height="683" alt="52270233795_5979a3174d_b" src="https://github.com/user-attachments/assets/f6b4737e-32ef-4c33-86b2-76b81673cf20" /> ### Tracking - #35121 - #148922 ### FCPs - #123508 (comment) (stabilization plan, T-lang) - #155499 (comment) (never type stabilization modulo bugs, T-lang) - #155924 (comment) (make `Infallible = !`, T-libs) ### Related changes - Lint bump: #141937 - Rust 2024 edition change: - #123748 - #123508 - Various changes to lessen the effect of the breaking changes: - #157820 - #156047 - #160705 - Never type documentation changes: #158370 (blocked on this pr) ### Experiments - Fallback change and never type stabilization: - Run: #155499 (comment) - Analysis: #155499 (comment) - Status of backports: #155499 (comment) - Fallback change, never type stabilization and making `Infallible = !`: #155500 - Fallback change, never type stabilization, making `Infallible = !`, and removing reservation impl: #155501 - Never type stabilization and `Infallible = !` change, _without_ fallback change: #155657 --- Closes #35121 Closes #148922
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 24, 2026
… r=JonathanBrouwer stabilize never type ### This PR - stabilizes the [never type](https://doc.rust-lang.org/stable/std/primitive.never.html) (aka `!`) (!!!) - sets the [never type fallback](https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html) to `!` on all editions (breaking change, see [crater report analysis](rust-lang#155499 (comment)) and [refresher on never type fallback](rust-lang#155499 (comment))) - makes `Infallible` an alias to `!` - removes `dependency_on_unit_never_type_fallback` lint (there is no more never type fallback to `()` so this lint can't be triggered) ### Cat <img width="1024" height="683" alt="52270233795_5979a3174d_b" src="https://github.com/user-attachments/assets/f6b4737e-32ef-4c33-86b2-76b81673cf20" /> ### Tracking - rust-lang#35121 - rust-lang#148922 ### FCPs - rust-lang#123508 (comment) (stabilization plan, T-lang) - rust-lang#155499 (comment) (never type stabilization modulo bugs, T-lang) - rust-lang#155924 (comment) (make `Infallible = !`, T-libs) ### Related changes - Lint bump: rust-lang#141937 - Rust 2024 edition change: - rust-lang#123748 - rust-lang#123508 - Various changes to lessen the effect of the breaking changes: - rust-lang#157820 - rust-lang#156047 - rust-lang#160705 - Never type documentation changes: rust-lang#158370 (blocked on this pr) ### Experiments - Fallback change and never type stabilization: - Run: rust-lang#155499 (comment) - Analysis: rust-lang#155499 (comment) - Status of backports: rust-lang#155499 (comment) - Fallback change, never type stabilization and making `Infallible = !`: rust-lang#155500 - Fallback change, never type stabilization, making `Infallible = !`, and removing reservation impl: rust-lang#155501 - Never type stabilization and `Infallible = !` change, _without_ fallback change: rust-lang#155657 --- Closes rust-lang#35121 Closes rust-lang#148922
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 24, 2026
…Brouwer stabilize never type ### This PR - stabilizes the [never type](https://doc.rust-lang.org/stable/std/primitive.never.html) (aka `!`) (!!!) - sets the [never type fallback](https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html) to `!` on all editions (breaking change, see [crater report analysis](#155499 (comment)) and [refresher on never type fallback](#155499 (comment))) - makes `Infallible` an alias to `!` - removes `dependency_on_unit_never_type_fallback` lint (there is no more never type fallback to `()` so this lint can't be triggered) ### Cat <img width="1024" height="683" alt="52270233795_5979a3174d_b" src="https://github.com/user-attachments/assets/f6b4737e-32ef-4c33-86b2-76b81673cf20" /> ### Tracking - #35121 - #148922 ### FCPs - #123508 (comment) (stabilization plan, T-lang) - #155499 (comment) (never type stabilization modulo bugs, T-lang) - #155924 (comment) (make `Infallible = !`, T-libs) ### Related changes - Lint bump: #141937 - Rust 2024 edition change: - #123748 - #123508 - Various changes to lessen the effect of the breaking changes: - #157820 - #156047 - #160705 - Never type documentation changes: #158370 (blocked on this pr) ### Experiments - Fallback change and never type stabilization: - Run: #155499 (comment) - Analysis: #155499 (comment) - Status of backports: #155499 (comment) - Fallback change, never type stabilization and making `Infallible = !`: #155500 - Fallback change, never type stabilization, making `Infallible = !`, and removing reservation impl: #155501 - Never type stabilization and `Infallible = !` change, _without_ fallback change: #155657 --- Closes #35121 Closes #148922
WaffleLapkin
marked this pull request as ready for review
August 25, 2026 08:57
This comment has been minimized.
This comment has been minimized.
pull Bot
pushed a commit
to xtqqczze/rust-lang-miri
that referenced
this pull request
Aug 25, 2026
…Brouwer stabilize never type ### This PR - stabilizes the [never type](https://doc.rust-lang.org/stable/std/primitive.never.html) (aka `!`) (!!!) - sets the [never type fallback](https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html) to `!` on all editions (breaking change, see [crater report analysis](rust-lang/rust#155499 (comment)) and [refresher on never type fallback](rust-lang/rust#155499 (comment))) - makes `Infallible` an alias to `!` - removes `dependency_on_unit_never_type_fallback` lint (there is no more never type fallback to `()` so this lint can't be triggered) ### Cat <img width="1024" height="683" alt="52270233795_5979a3174d_b" src="https://github.com/user-attachments/assets/f6b4737e-32ef-4c33-86b2-76b81673cf20" /> ### Tracking - rust-lang/rust#35121 - rust-lang/rust#148922 ### FCPs - rust-lang/rust#123508 (comment) (stabilization plan, T-lang) - rust-lang/rust#155499 (comment) (never type stabilization modulo bugs, T-lang) - rust-lang/rust#155924 (comment) (make `Infallible = !`, T-libs) ### Related changes - Lint bump: rust-lang/rust#141937 - Rust 2024 edition change: - rust-lang/rust#123748 - rust-lang/rust#123508 - Various changes to lessen the effect of the breaking changes: - rust-lang/rust#157820 - rust-lang/rust#156047 - rust-lang/rust#160705 - Never type documentation changes: rust-lang/rust#158370 (blocked on this pr) ### Experiments - Fallback change and never type stabilization: - Run: rust-lang/rust#155499 (comment) - Analysis: rust-lang/rust#155499 (comment) - Status of backports: rust-lang/rust#155499 (comment) - Fallback change, never type stabilization and making `Infallible = !`: rust-lang/rust#155500 - Fallback change, never type stabilization, making `Infallible = !`, and removing reservation impl: rust-lang/rust#155501 - Never type stabilization and `Infallible = !` change, _without_ fallback change: rust-lang/rust#155657 --- Closes rust-lang/rust#35121 Closes rust-lang/rust#148922
traviscross
approved these changes
Aug 25, 2026
Contributor
|
This looks good to me. Thanks @WaffleLapkin. |
WaffleLapkin
force-pushed
the
never-scratch-docs
branch
from
August 26, 2026 11:45
cd5b51c to
c68342d
Compare
Collaborator
|
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. |
JonathanBrouwer
approved these changes
Aug 26, 2026
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 26, 2026
…=JonathanBrouwer,traviscross rewrite never type documentation With the never type stabilization in rust-lang#155499, I think the never type documentation needs be improved, as the status quo is not the best ^^'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
View all comments
With the never type stabilization in #155499, I think the never type documentation needs be improved, as the status quo is not the best ^^'