Skip to content

stabilize never type - #155499

Open
WaffleLapkin wants to merge 19 commits into
rust-lang:mainfrom
WaffleLapkin:stabilize-never-type
Open

stabilize never type#155499
WaffleLapkin wants to merge 19 commits into
rust-lang:mainfrom
WaffleLapkin:stabilize-never-type

Conversation

@WaffleLapkin

@WaffleLapkin WaffleLapkin commented Apr 18, 2026

Copy link
Copy Markdown
Member

View all comments

This PR

Cat

52270233795_5979a3174d_b

Tracking

FCPs

Related changes

Experiments


Closes #35121
Closes #148922

@rustbot

This comment was marked as off-topic.

@rustbot

This comment was marked as off-topic.

@rustbot rustbot added A-rustdoc-js Area: Rustdoc's JS front-end A-rustdoc-json Area: Rustdoc JSON backend A-rustdoc-search Area: Rustdoc's search feature S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Apr 18, 2026
@rustbot

This comment has been minimized.

@WaffleLapkin
WaffleLapkin marked this pull request as draft April 18, 2026 22:14
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 18, 2026
@WaffleLapkin

Copy link
Copy Markdown
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 18, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 1c4199d (1c4199da70f816f2239f41c55168ff75a3663718, parent: b2f1ccf524a3a4cf9c34545167cc23b659cf1cbd)

@WaffleLapkin
WaffleLapkin force-pushed the stabilize-never-type branch from 2895d33 to 3e8df8d Compare April 19, 2026 01:05
@WaffleLapkin

Copy link
Copy Markdown
Member Author

@craterbot

Copy link
Copy Markdown
Collaborator

👌 Experiment pr-155499 created and queued.
🤖 Automatically detected try build 1c4199d
⚠️ Try build based on commit 2895d33, but latest commit is 3e8df8d. Did you forget to make a new try build?
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 19, 2026
@craterbot

Copy link
Copy Markdown
Collaborator

🚧 Experiment pr-155499 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

Copy link
Copy Markdown
Collaborator

🎉 Experiment pr-155499 is completed!
📊 3277 regressed and 0 fixed (9024 total)
📊 1149 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-155499/retry-regressed-list.txt

@rustbot

This comment has been minimized.

@JonathanBrouwer JonathanBrouwer added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 18, 2026

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

Not finished with review yet, but this is the first part

View changes since this review

}

fn never_type_behavior(tcx: TyCtxt<'_>) -> (DivergingFallbackBehavior, DivergingBlockBehavior) {
// FIXME(waffle): rip out the whole system which allows you to choose never type fallback

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.

It would be nice to do this immediately after this PR lands, so that this is not forgotten. Rust analyzer seems to have its own copy of this enum, funnily enough.
Can we somehow make sure this is not forgotten?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already have a commit for it in my local checkout, so I'm unlikely to forget:
jj commit (empty) TODO: rip out the never type fallback system, to make it simpler

// For backwards compatibility reasons, we fall back to
// `()` until we the diverging default is changed.
EarlyBinder::bind(tcx, tcx.types.unit)
EarlyBinder::bind(tcx, tcx.types.never)

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.

This change looks right to me, but I feel like I don't have enough type system knowledge to be 100% sure about this change.

I wonder why this wasn't affected by the rustc_never_type_options attribute, was that an accident?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC this wasn't affected by the attribute on purpose, but I don't remember the details.

Comment thread library/core/src/primitive_docs.rs
Comment thread library/core/src/primitive_docs.rs
Comment thread src/doc/edition-guide
Comment thread library/std/src/process.rs
Comment thread compiler/rustc_lint_defs/src/builtin.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 18, 2026
@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Aug 19, 2026

Copy link
Copy Markdown
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.

@WaffleLapkin WaffleLapkin added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustdoc-js Area: Rustdoc's JS front-end A-rustdoc-json Area: Rustdoc JSON backend A-rustdoc-search Area: Rustdoc's search feature disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. needs-reference-pr This language change needs an approved Reference PR to proceed. S-blocked Status: Blocked on something else such as an RFC or other implementation work. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. to-announce Announce this issue on triage meeting WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking Issue for never type fallback change Tracking issue for promoting ! to a type (RFC 1216)