Skip to content

Update for stabilization of the never type - #2283

Open
ehuss wants to merge 7 commits into
rust-lang:masterfrom
ehuss:stabilize-never
Open

Update for stabilization of the never type#2283
ehuss wants to merge 7 commits into
rust-lang:masterfrom
ehuss:stabilize-never

Conversation

@ehuss

Copy link
Copy Markdown
Contributor

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

cc @WaffleLapkin

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

@WaffleLapkinWaffleLapkinJun 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

Copy link
Copy Markdown
ContributorAuthor

Thanks @WaffleLapkin!

@WaffleLapkinWaffleLapkin 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.

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.
@rustbot

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.

@traviscrosstraviscross removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 23, 2026
traviscrossand others added 6 commits June 23, 2026 21:10
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.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-stabilizationWaiting 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

@ehuss@rustbot@traviscross@WaffleLapkin