Skip to content

stabilize never type - #155499

Merged
rust-bors[bot] merged 18 commits into
rust-lang:mainfrom
WaffleLapkin:stabilize-never-type
Aug 24, 2026
Merged

stabilize never type#155499
rust-bors[bot] merged 18 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

@JonathanBrouwer

JonathanBrouwer commented Aug 24, 2026

Copy link
Copy Markdown
Member

Way to ruin a dramatic moment bors /j
We should also merge the reference pr rust-lang/reference#2283
@bors r+

@rust-bors

rust-bors Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit b74b72b has been approved by JonathanBrouwer

It is now in the queue for this repository.

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors rollup=iffy causes breakage

@rust-bors

This comment has been minimized.

@JonathanBrouwer

Copy link
Copy Markdown
Member

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #161685 (comment)

@rust-bors

rust-bors Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

Auto build was cancelled due to unapproval. Cancelled workflows:

View changes since this unapproval

@JonathanBrouwer

JonathanBrouwer commented Aug 24, 2026

Copy link
Copy Markdown
Member

Description:
A publicly-visible enum cannot be imported by its prior path. A pub use may have been removed, or the enum itself > may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_missing.ron

Failed in:
enum core::convert::Infallible, previously in file library/core/src/convert/mod.rs:920

This is a false positive in cargo-semver-checks (cc @obi1kenobi)
The type is still there, it just turned from a pub enum into a pub type
@bors r+

@rust-bors

rust-bors Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 0a35c2a has been approved by JonathanBrouwer

It is now in the queue for this repository.

@asquared31415

Copy link
Copy Markdown
Contributor

I believe pub enum -> not enum is a breaking change, but it's an intended breakage.

@scottmcm

Copy link
Copy Markdown
Member

For an enum with variants I think it is, but in this weird case where it doesn't have any variants it might not be?

Regardless, it's something we've been working towards for years so this instance we'll let through for sure.

@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 7m 55s
Pushing e776960 to main...

@github-actions

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 0a3fa2a (parent) -> e776960 (this PR)

Test differences

Show 1825 test diffs

Stage 1

  • [ui] tests/ui/coercion/coerce-issue-49593-box-never.rs: [missing] -> pass (J1)
  • [ui] tests/ui/coercion/coerce-issue-49593-box-never.rs#e2021: pass -> [missing] (J1)
  • [ui] tests/ui/coercion/coerce-issue-49593-box-never.rs#e2024: pass -> [missing] (J1)
  • [ui] tests/ui/feature-gates/feature-gate-never_type.rs: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/defaulted-never-note.rs: [missing] -> pass (J1)
  • [ui] tests/ui/never_type/fallback_change/defaulted-never-note.rs#e2021: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/defaulted-never-note.rs#e2024: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/diverging-fallback-unconstrained-return.rs: [missing] -> pass (J1)
  • [ui] tests/ui/never_type/fallback_change/diverging-fallback-unconstrained-return.rs#e2021: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/diverging-fallback-unconstrained-return.rs#e2024: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/dont-suggest-turbofish-from-expansion.rs: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-ret.rs: [missing] -> pass (J1)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-ret.rs#e2021: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-ret.rs#e2024: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-wrap.rs: [missing] -> pass (J1)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-wrap.rs#e2021: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-wrap.rs#e2024: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/lint-never-type-fallback-flowing-into-unsafe.rs: [missing] -> pass (J1)
  • [ui] tests/ui/never_type/fallback_change/lint-never-type-fallback-flowing-into-unsafe.rs#e2015: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/lint-never-type-fallback-flowing-into-unsafe.rs#e2024: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs: [missing] -> pass (J1)
  • [ui] tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs#e2021: pass -> [missing] (J1)
  • [ui] tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs#e2024: pass -> [missing] (J1)
  • [ui (polonius)] tests/ui/coercion/coerce-issue-49593-box-never.rs: [missing] -> pass (J2)
  • [ui (polonius)] tests/ui/coercion/coerce-issue-49593-box-never.rs#e2021: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/coercion/coerce-issue-49593-box-never.rs#e2024: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/feature-gates/feature-gate-never_type.rs: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/defaulted-never-note.rs: [missing] -> pass (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/defaulted-never-note.rs#e2021: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/defaulted-never-note.rs#e2024: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/diverging-fallback-unconstrained-return.rs: [missing] -> pass (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/diverging-fallback-unconstrained-return.rs#e2021: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/diverging-fallback-unconstrained-return.rs#e2024: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/dont-suggest-turbofish-from-expansion.rs: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/fallback-closure-ret.rs: [missing] -> pass (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/fallback-closure-ret.rs#e2021: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/fallback-closure-ret.rs#e2024: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/fallback-closure-wrap.rs: [missing] -> pass (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/fallback-closure-wrap.rs#e2021: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/fallback-closure-wrap.rs#e2024: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/lint-never-type-fallback-flowing-into-unsafe.rs: [missing] -> pass (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/lint-never-type-fallback-flowing-into-unsafe.rs#e2015: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/lint-never-type-fallback-flowing-into-unsafe.rs#e2024: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs: [missing] -> pass (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs#e2021: pass -> [missing] (J2)
  • [ui (polonius)] tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs#e2024: pass -> [missing] (J2)

Stage 2

  • [ui] tests/ui/coercion/coerce-issue-49593-box-never.rs: [missing] -> pass (J0)
  • [ui] tests/ui/coercion/coerce-issue-49593-box-never.rs#e2021: pass -> [missing] (J0)
  • [ui] tests/ui/coercion/coerce-issue-49593-box-never.rs#e2024: pass -> [missing] (J0)
  • [ui] tests/ui/feature-gates/feature-gate-never_type.rs: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/defaulted-never-note.rs: [missing] -> pass (J0)
  • [ui] tests/ui/never_type/fallback_change/defaulted-never-note.rs#e2021: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/defaulted-never-note.rs#e2024: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/diverging-fallback-unconstrained-return.rs: [missing] -> pass (J0)
  • [ui] tests/ui/never_type/fallback_change/diverging-fallback-unconstrained-return.rs#e2021: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/diverging-fallback-unconstrained-return.rs#e2024: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/dont-suggest-turbofish-from-expansion.rs: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-ret.rs: [missing] -> pass (J0)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-ret.rs#e2021: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-ret.rs#e2024: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-wrap.rs: [missing] -> pass (J0)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-wrap.rs#e2021: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/fallback-closure-wrap.rs#e2024: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/lint-never-type-fallback-flowing-into-unsafe.rs: [missing] -> pass (J0)
  • [ui] tests/ui/never_type/fallback_change/lint-never-type-fallback-flowing-into-unsafe.rs#e2015: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/lint-never-type-fallback-flowing-into-unsafe.rs#e2024: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs: [missing] -> pass (J0)
  • [ui] tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs#e2021: pass -> [missing] (J0)
  • [ui] tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs#e2024: pass -> [missing] (J0)

Additionally, 1756 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard e7769602aca3770e8d8ea55716becb22e839a579 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-msvc-ext1: 1h 27m -> 2h 9m (+47.7%)
  2. x86_64-msvc-2: 1h 54m -> 2h 40m (+39.7%)
  3. dist-i686-mingw: 2h 50m -> 1h 49m (-35.9%)
  4. x86_64-gnu-llvm-21-2: 1h 31m -> 1h (-33.7%)
  5. dist-x86_64-llvm-mingw: 1h 40m -> 2h 11m (+30.8%)
  6. dist-ohos-armv7: 58m 7s -> 1h 15m (+30.6%)
  7. dist-x86_64-illumos: 1h 25m -> 1h 51m (+29.9%)
  8. dist-various-2: 39m 6s -> 49m 25s (+26.4%)
  9. dist-x86_64-msvc: 3h 9m -> 2h 22m (-25.0%)
  10. x86_64-gnu-next-trait-solver-polonius: 57m 10s -> 43m 2s (-24.7%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (e776960): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.1%] 10
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -3.9%, secondary -1.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.9% [-3.9%, -3.9%] 1
Improvements ✅
(secondary)
-1.8% [-2.6%, -1.0%] 2
All ❌✅ (primary) -3.9% [-3.9%, -3.9%] 1

Cycles

Results (primary -1.2%, secondary -4.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.7% [3.7%, 3.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.4% [-2.7%, -2.3%] 4
Improvements ✅
(secondary)
-4.5% [-5.9%, -2.4%] 3
All ❌✅ (primary) -1.2% [-2.7%, 3.7%] 5

Binary size

Results (primary -0.1%, secondary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.1%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.2%, -0.0%] 55
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.0%] 36
All ❌✅ (primary) -0.1% [-0.2%, 0.1%] 58

Bootstrap: 469.763s -> 471.419s (0.35%)
Artifact size: 400.31 MiB -> 400.34 MiB (0.01%)

@theemathas

Copy link
Copy Markdown
Contributor

@JonathanBrouwer Not a false positive. I think that use std::convert::Infallible::{self}; will stop compiling after the change.

@obi1kenobi

Copy link
Copy Markdown
Member

I think we're all on the same page about the (possible) breakage being fine for this PR.

Now purely for our collective curiosity ...

@JonathanBrouwer Not a false positive. I think that use std::convert::Infallible::{self}; will stop compiling after the change.

Even if that's the case, does this fall under the "useless code" exception? As in, if that and only that is the only breakage, is that truly SemVer-major given that that code by itself has no purpose?

For an enum with variants I think it is, but in this weird case where it doesn't have any variants it might not be?

This was also my first thought. But I admittedly haven't thought enough about the zero-variant case.

If we need to add a "has at least one variant" clause, I think that should be easy enough. Type aliases are also a bit of a nightmare for SemVer though, and I definitely haven't even worked out the full set of edge cases yet, let alone implemented all of them in c-s-c.

@obi1kenobi

Copy link
Copy Markdown
Member

Also — 🎉🎉🎉 Congrats! So glad this is finally merged, and in such a nice round-numbered release too :)

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. merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. relnotes Marks issues that should be documented in the release notes of the next release. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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)