Skip to content

Update for stabilization of the never type - #2283

Merged
traviscross merged 7 commits into
rust-lang:masterfrom
ehuss:stabilize-never
Aug 25, 2026
Merged

Update for stabilization of the never type#2283
traviscross merged 7 commits into
rust-lang:masterfrom
ehuss:stabilize-never

Conversation

@ehuss

@ehuss ehuss commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

This updates for the stabilization of the never type proposed in rust-lang/rust#155499.

cc @WaffleLapkin

@ehuss ehuss added the S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository label Jun 12, 2026
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 12, 2026
Comment thread src/expressions/match-expr.md
Comment thread src/types/never.md Outdated
Comment thread src/types/never.md Outdated
Comment thread src/divergence.md
Comment on lines -78 to -79
> [!EDITION-2024]
> Before the 2024 edition, the type was inferred to instead be `()`.

@WaffleLapkin WaffleLapkin Jun 12, 2026

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.

A shame that we can't represent "before rust x.y.z with edition < 2024"...

View changes since the review

@ehuss
ehuss force-pushed the stabilize-never branch from 0f31fc6 to 6e3c505 Compare June 15, 2026 19:47
@ehuss

ehuss commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @WaffleLapkin!

@WaffleLapkin WaffleLapkin left a comment

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.

@rustbot

This comment has been minimized.

@traviscross traviscross removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 23, 2026
traviscross and others added 7 commits August 25, 2026 19:33
Stabilizing the never type means making `!` available in all positions
and changing the never-to-any coercion fallback type to `!` in older
editions.  Let's make the updates needed for that.
In various places, we had worked around the never type being unstable
when writing examples.  Now that it is stable, let's clean those
examples up.
This moves type.never.intro to the top of the chapter to match the style
where the intro should always come first in a section.
This moves the never example to the intro to match our layout style, and
adds an example showing a type expression using `!`.
Never can coerce to itself.
This tries to punch up the never type intro by linking to the divergence
chapter.
@rustbot

rustbot commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master 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.

@traviscross
traviscross added this pull request to the merge queue Aug 25, 2026
Merged via the queue into rust-lang:master with commit b7d024a Aug 25, 2026
7 checks passed
@traviscross

Copy link
Copy Markdown
Contributor

Thanks @WaffleLapkin; thanks @ehuss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants