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

@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 added 4 commits June 12, 2026 11:04
With stabilization of never, this constraint is removed.

rust-lang#2186 will handle adding call
expression divergence behavior.
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 `!`.
In the stabilization, the dependency_on_unit_never_type_fallback is
being made a hard error in all editions.
@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 added 3 commits June 15, 2026 12:29
Some of these examples can be simplified with using the never type.
Never can coerce to itself.
This tries to punch up the never type intro by linking to the divergence
chapter.
@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!

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

Labels

S-waiting-on-review Status: The marked PR is awaiting review from a maintainer 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.

3 participants