Skip to content

[experiment] meow#154887

Draft
WaffleLapkin wants to merge 17 commits intorust-lang:mainfrom
WaffleLapkin:never-type-madness
Draft

[experiment] meow#154887
WaffleLapkin wants to merge 17 commits intorust-lang:mainfrom
WaffleLapkin:never-type-madness

Conversation

@WaffleLapkin
Copy link
Copy Markdown
Member

meow meow meow meow meow

@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 A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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-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 6, 2026
@WaffleLapkin WaffleLapkin added F-never_type `#![feature(never_type)]` S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed A-rustdoc-search Area: Rustdoc's search feature A-rustdoc-json Area: Rustdoc JSON backend A-rustdoc-js Area: Rustdoc's JS front-end labels Apr 6, 2026
@rust-log-analyzer

This comment has been minimized.

Add a hack to tidy to consider stuff like
`#[cfg_attr(bootstrap, doc = "feature(never_type)")]` to be part of a
comment, and thus don't break stuff when counting backticks.
??? why wasn't this detected by compiletest ???
@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 labels Apr 6, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

error[E0277]: the trait bound `!: Unit` is not satisfied
##[error]   --> rust-2024/never-type-fallback.md:111:1
    |
111 | run(|| panic!());
    | ^^^^^^^^^^^^^^^^ the trait `Unit` is not implemented for `!`
    |
help: the trait `Unit` is implemented for `()`
   --> rust-2024/never-type-fallback.md:105:1
    |
105 | impl Unit for () {}
    | ^^^^^^^^^^^^^^^^
    = note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #148922 <https://github.com/rust-lang/rust/issues/148922> for more information)
    = help: you might have intended to use the type `()` here instead
note: required by a bound in `run`
   --> rust-2024/never-type-fallback.md:107:11
    |
107 | fn run<R: Unit>(f: impl FnOnce() -> R) {
    |           ^^^^ required by this bound in `run`

error: aborting due to 1 previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
---
   = help: you might have intended to use the type `()` here instead
note: required by a bound in `f`
  --> rust-2024/never-type-fallback.md:74:9
   |
74 | fn f<T: Default>() -> Result<T, ()> {
   |         ^^^^^^^ required by this bound in `f`

error: aborting due to 1 previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
---

--- 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::BookTest>::run_ext_doc
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:2704:57
   5: <bootstrap::core::build_steps::test::BookTest as bootstrap::core::builder::Step>::run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:2619:18
---
   8: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::EditionGuide>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1579:36
   9: <bootstrap::core::build_steps::test::EditionGuide as bootstrap::core::builder::Step>::make_run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:2778:33
  10: <bootstrap::core::builder::StepDescription>::maybe_run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:476:13
  11: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at /checkout/src/bootstrap/src/core/builder/cli_paths.rs:232:18
  12: <bootstrap::core::builder::Builder>::run_step_descriptions
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1122:9
  13: <bootstrap::core::builder::Builder>::execute_cli
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1101:14
  14: <bootstrap::Build>::build
             at /checkout/src/bootstrap/src/lib.rs:799:25
  15: bootstrap::main
             at /checkout/src/bootstrap/src/bin/main.rs:130:11
  16: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/ops/function.rs:250:5
  17: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/sys/backtrace.rs:166:18
  18: std::rt::lang_start::<()>::{closure#0}
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/rt.rs:206:18
  19: <&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/ops/function.rs:287:21
  20: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync, i32>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:581:40
  21: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:544:19
  22: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync, i32>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panic.rs:359:14
  23: std::rt::lang_start_internal::{closure#0}
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/rt.rs:175:24
  24: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:581:40
---
tests/ui/should_impl_trait/method_list_1.rs (revision `edition2021`) ... ok
tests/ui/crashes/third-party/conf_allowlisted.rs ... ok

FAILED TEST: tests/ui/unused_unit.rs (revision `edition2021`)
command: CLIPPY_CONF_DIR="tests" RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui" "tests/ui/unused_unit.rs" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rmeta" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rlib" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rmeta" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rlib" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rmeta" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rlib" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rmeta" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rlib" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rmeta" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rlib" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rmeta" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rlib" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2021" "--cfg=edition2021" "-Cextra-filename=edition2021"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/unused_unit.edition2021.stderr` to the actual output
--- tests/ui/unused_unit.edition2021.stderr
+++ <stderr output>
---

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:22:28
   |
LL |     pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
   |                            ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:25:18
   |
LL |     where G: Fn() -> () {
   |                  ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:22:58
   |
LL |     pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
   |                                                          ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:27:26
   |
LL |         let _y: &dyn Fn() -> () = &f;
   |                          ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:35:18
   |
LL |     fn into(self) -> () {
   |                  ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:43:29
   |
LL |     fn redundant<F: FnOnce() -> (), G, H>(&self, _f: F, _g: G, _h: H)
   |                             ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:46:19
   |
LL |         G: FnMut() -> (),
   |                   ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:48:16
   |
LL |         H: Fn() -> ();
   |                ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:53:29
   |
LL |     fn redundant<F: FnOnce() -> (), G, H>(&self, _f: F, _g: G, _h: H)
   |                             ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:56:19
   |
LL |         G: FnMut() -> (),
---

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:95:10
   |
LL | fn test()->(){}
   |          ^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:99:11
   |
LL | fn test2() ->(){}
   |           ^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:103:11
   |
LL | fn test3()-> (){}
   |           ^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:131:13
   |
LL |     fn bar() -> () {
---
error: there was 1 unmatched diagnostic
##[error]   --> tests/ui/unused_unit.rs:130:13
    |
130 |     #[allow(dependency_on_unit_never_type_fallback)]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error[renamed_and_removed_lints]: lint `dependency_on_unit_never_type_fallback` has been removed: the code warned by this lint no longer compiles
    |

full stderr:
error: unneeded unit expression
##[error]  --> tests/ui/unused_unit.rs:37:9
---

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:22:28
   |
LL |     pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
   |                            ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:25:18
   |
LL |     where G: Fn() -> () {
   |                  ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:22:58
   |
LL |     pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
   |                                                          ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:27:26
   |
LL |         let _y: &dyn Fn() -> () = &f;
   |                          ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:35:18
   |
LL |     fn into(self) -> () {
   |                  ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:43:29
   |
LL |     fn redundant<F: FnOnce() -> (), G, H>(&self, _f: F, _g: G, _h: H)
   |                             ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:46:19
   |
LL |         G: FnMut() -> (),
   |                   ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:48:16
   |
LL |         H: Fn() -> ();
   |                ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:53:29
   |
LL |     fn redundant<F: FnOnce() -> (), G, H>(&self, _f: F, _g: G, _h: H)
   |                             ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:56:19
   |
LL |         G: FnMut() -> (),
---

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:95:10
   |
LL | fn test()->(){}
   |          ^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:99:11
   |
LL | fn test2() ->(){}
   |           ^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:103:11
   |
LL | fn test3()-> (){}
   |           ^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:131:13
   |
LL |     fn bar() -> () {
---



FAILED TEST: tests/ui/unused_unit.rs (revision `edition2024`)
command: CLIPPY_CONF_DIR="tests" RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui" "tests/ui/unused_unit.rs" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rmeta" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rlib" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rmeta" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rlib" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rmeta" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rlib" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rmeta" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rlib" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rmeta" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rlib" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rmeta" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rlib" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2024" "--cfg=edition2024" "-Cextra-filename=edition2024"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/unused_unit.edition2024.stderr` to the actual output
--- tests/ui/unused_unit.edition2024.stderr
+++ <stderr output>
---

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:22:28
   |
LL |     pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
   |                            ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:25:18
   |
LL |     where G: Fn() -> () {
   |                  ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:22:58
   |
LL |     pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
   |                                                          ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:27:26
   |
LL |         let _y: &dyn Fn() -> () = &f;
   |                          ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:35:18
   |
LL |     fn into(self) -> () {
   |                  ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:43:29
   |
LL |     fn redundant<F: FnOnce() -> (), G, H>(&self, _f: F, _g: G, _h: H)
   |                             ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:46:19
   |
LL |         G: FnMut() -> (),
   |                   ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:48:16
   |
LL |         H: Fn() -> ();
   |                ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:53:29
   |
LL |     fn redundant<F: FnOnce() -> (), G, H>(&self, _f: F, _g: G, _h: H)
   |                             ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:56:19
   |
LL |         G: FnMut() -> (),
---

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:95:10
   |
LL | fn test()->(){}
   |          ^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:99:11
   |
LL | fn test2() ->(){}
   |           ^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:103:11
   |
LL | fn test3()-> (){}
   |           ^^^^^ help: remove the `-> ()`

error: aborting due to 20 previous errors



error: there was 1 unmatched diagnostic
##[error]   --> tests/ui/unused_unit.rs:130:13
    |
130 |     #[allow(dependency_on_unit_never_type_fallback)]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error[renamed_and_removed_lints]: lint `dependency_on_unit_never_type_fallback` has been removed: the code warned by this lint no longer compiles
    |

full stderr:
error: unneeded unit expression
##[error]  --> tests/ui/unused_unit.rs:37:9
---

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:22:28
   |
LL |     pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
   |                            ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:25:18
   |
LL |     where G: Fn() -> () {
   |                  ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:22:58
   |
LL |     pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
   |                                                          ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:27:26
   |
LL |         let _y: &dyn Fn() -> () = &f;
   |                          ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:35:18
   |
LL |     fn into(self) -> () {
   |                  ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:43:29
   |
LL |     fn redundant<F: FnOnce() -> (), G, H>(&self, _f: F, _g: G, _h: H)
   |                             ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:46:19
   |
LL |         G: FnMut() -> (),
   |                   ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:48:16
   |
LL |         H: Fn() -> ();
   |                ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:53:29
   |
LL |     fn redundant<F: FnOnce() -> (), G, H>(&self, _f: F, _g: G, _h: H)
   |                             ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:56:19
   |
LL |         G: FnMut() -> (),
---

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:95:10
   |
LL | fn test()->(){}
   |          ^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:99:11
   |
LL | fn test2() ->(){}
   |           ^^^^^ help: remove the `-> ()`

error: unneeded unit return type
##[error]  --> tests/ui/unused_unit.rs:103:11
   |
LL | fn test3()-> (){}
   |           ^^^^^ help: remove the `-> ()`

error: aborting due to 20 previous errors


full stdout:

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 A-tidy Area: The tidy tool F-never_type `#![feature(never_type)]` S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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-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.

3 participants