Skip to content

stabilize never type#155499

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

stabilize never type#155499
WaffleLapkin wants to merge 13 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:

Stabilization plan FCP:

Lint bump:

Rust 2024 edition change:

@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

rustbot commented Apr 18, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

@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

@rust-rfcbot

Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

Comment on lines -64 to -65
// Only suggest the `never_type` if the feature is enabled
&& cx.tcx.features().never_type()

@theemathas theemathas Jun 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this Clippy lint should not fire if the project have an MSRV that supports Rust before this stabilization.

Also, I'm not sure I agree with current lint description which suggests writing a struct Thing(pub !);

View changes since the review

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.

Checking MSRV requires knowing in which release the never type will be merged, so I'll leave this as a follow-up.

Don't really agree with the lint either, but that's unrelated to this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment on lines 304 to 306

@ehuss ehuss Jun 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we're changing this in this PR, then I think these docs need updating.

View changes since the review

@ehuss

ehuss commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

I'm unclear if the Infallible changes will also be made in this PR at the same time?

Either way, I recommend addressing the docs here saying never is unstable.

@traviscross

Copy link
Copy Markdown
Contributor

I'm unclear if the Infallible changes will also be made in this PR at the same time?

@WaffleLapkin had mentioned wanting to land that in a separate PR. We do need to ensure these land in the same release, of course.

@ehuss

ehuss commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What's the story with never_type_fallback_flowing_into_unsafe? I'm guessing you want to keep it for now? And then make it a hard error in the future?

If you want to keep it, I suggest updating it so that it is FutureReleaseSemanticsChange and to update its documentation so that it is updated for the never stabilization.

@traviscross

traviscross commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What's the story with never_type_fallback_flowing_into_unsafe? I'm guessing you want to keep it for now? And then make it a hard error in the future?

Probably I wouldn't expect us to make this a hard error (the semantics are clear and making it a hard error would not simplify the language definition). I'm happy with it at deny-by-default for now. Looking at it:

    pub NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE,
    Deny,
    "never type fallback affecting unsafe function calls",
    @future_incompatible = FutureIncompatibleInfo {
        reason: fcw!(EditionAndFutureReleaseSemanticsChange 2024 "never-type-fallback"),
        report_in_deps: true,
    };
    @edition Edition2024 => Deny;
    report_in_external_macro

Probably I'd expect we want to remove the FCW- and edition-related bits and make this a plain deny-by-default lint — once this PR goes in, it will no longer be linting about anything happening in the future.

@tbu-

tbu- commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Probably I'd expect we want to remove the FCW- and edition-related bits and make this a plain deny-by-default lint

This would mean it'd not show up for dependencies, which was useful.

@WaffleLapkin WaffleLapkin force-pushed the stabilize-never-type branch from 02de51f to 5675e12 Compare June 16, 2026 17:12
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@WaffleLapkin WaffleLapkin force-pushed the stabilize-never-type branch from 5675e12 to 8b0d675 Compare June 16, 2026 20:20
@rustbot

rustbot commented Jun 16, 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.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
fmt: checked 6917 files
tidy check
tidy [rustdoc_json (src)]: `rustdoc-json-types` modified, checking format version
tidy: Skipping binary file check, read-only filesystem
tidy [alphabetical (compiler)]: /checkout/compiler/rustc_ast_ir/src/lib.rs:9: line not in alphabetical order (tip: use --bless to sort this list)
tidy [alphabetical (compiler)]: FAIL
removing old virtual environment
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10' and 'venv'
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10' and 'virtualenv'
Requirement already satisfied: pip in ./build/venv/lib/python3.10/site-packages (26.1.1)
Collecting pip
---
info: ✓ ES-Check passed! All files are ES10 compatible.
typechecking javascript files
tidy: The following check failed: alphabetical (compiler)
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/rust-tidy --root-path=/checkout --cargo-path=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo --output-dir=/checkout/obj/build --concurrency=4 --npm-path=/node/bin/yarn --ci=true --extra-checks=py,cpp,js,spellcheck` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1624:23
Executed at: src/bootstrap/src/core/build_steps/test.rs:1511:29

--- BACKTRACE vvv
   0: <bootstrap::utils::exec::DeferredCommand>::finish_process
             at /checkout/src/bootstrap/src/utils/exec.rs:939:17
   1: <bootstrap::utils::exec::DeferredCommand>::wait_for_output::<&bootstrap::utils::exec::ExecutionContext>
             at /checkout/src/bootstrap/src/utils/exec.rs:831:21
   2: <bootstrap::utils::exec::ExecutionContext>::run
             at /checkout/src/bootstrap/src/utils/exec.rs:741:45
   3: <bootstrap::utils::exec::BootstrapCommand>::run::<&bootstrap::core::builder::Builder>
             at /checkout/src/bootstrap/src/utils/exec.rs:339:27
   4: <bootstrap::core::build_steps::test::Tidy as bootstrap::core::builder::Step>::run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:1511:29
   5: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::Tidy>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1596:36
   6: <bootstrap::core::build_steps::test::Tidy as bootstrap::core::builder::Step>::make_run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:1433:21
   7: <bootstrap::core::builder::StepDescription>::maybe_run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:476:13
   8: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at /checkout/src/bootstrap/src/core/builder/cli_paths.rs:232:18
   9: <bootstrap::core::builder::Builder>::run_step_descriptions
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1139:9
  10: <bootstrap::core::builder::Builder>::execute_cli
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1118:14
  11: <bootstrap::Build>::build
             at /checkout/src/bootstrap/src/lib.rs:803:25
  12: bootstrap::main
             at /checkout/src/bootstrap/src/bin/main.rs:130:11
  13: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/core/src/ops/function.rs:250:5
  14: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/sys/backtrace.rs:166:18
  15: std::rt::lang_start::<()>::{closure#0}
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/rt.rs:206:18
  16: <&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/core/src/ops/function.rs:287:21
  17: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:581:40
  18: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:544:19
  19: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panic.rs:359:14
  20: std::rt::lang_start_internal::{closure#0}
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/rt.rs:175:24
  21: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:581:40
---
  28: __libc_start_main
  29: _start


Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:02:44
  local time: Tue Jun 16 20:26:26 UTC 2026
  network time: Tue, 16 Jun 2026 20:26:26 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

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. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. 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. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.