Skip to content

Cleanup unused diagnostic emission methods#153452

Open
GuillaumeGomez wants to merge 9 commits intorust-lang:mainfrom
GuillaumeGomez:migrate-diag
Open

Cleanup unused diagnostic emission methods#153452
GuillaumeGomez wants to merge 9 commits intorust-lang:mainfrom
GuillaumeGomez:migrate-diag

Conversation

@GuillaumeGomez
Copy link
Member

Part of #153099.

To remove lint_level, we need to remove all functions calling it. One of them is TyCtxt::node_span_lint, so removing it.

r? @JonathanBrouwer

@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2026

HIR ty lowering was modified

cc @fmease

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 5, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2026

JonathanBrouwer is currently at their maximum review capacity.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

@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 Mar 5, 2026
@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2026

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Mar 5, 2026
@GuillaumeGomez
Copy link
Member Author

PR is not ready, we need to figure out why the tracking is currently broken in clippy:

--- tests/ui/track-diagnostics-clippy.stderr
+++ <stderr output>
 error: casting to the same type is unnecessary (`u32` -> `u32`)
   --> tests/ui/track-diagnostics-clippy.rs:LL:CC
... 2 lines skipped ...
    |             ^^^^^^^^ help: try: `a`
    |
-   = note: -Ztrack-diagnostics: created at clippy_lints/src/casts/unnecessary_cast.rs:LL:CC
+   = note: -Ztrack-diagnostics: created at compiler/rustc_middle/src/lint.rs:LL:CC
    = note: `-D clippy::unnecessary-cast` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_cast)]`
... 18 lines skipped ...
 error: aborting due to 2 previous errors

You can run this (specific) test with:

TESTNAME=track-diagnostics-clippy ./x.py test src/tools/clippy/ --stage 1

@rust-log-analyzer
Copy link
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)
/dev/sda15      105M  6.2M   99M   6% /boot/efi
tmpfs           1.6G   12K  1.6G   1% /run/user/1001
================================================================================

Sufficient disk space available (94882728KB >= 52428800KB). Skipping cleanup.
##[group]Run echo "[CI_PR_NUMBER=$num]"
echo "[CI_PR_NUMBER=$num]"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
---
tests/ui/drop_non_drop.rs ... ok
tests/ui/duplicate_underscore_argument.rs ... ok
tests/ui/duplicated_attributes.rs ... ok
tests/ui/double_parens.fixed ... ok
tests/ui/duration_suboptimal_units_days_weeks.rs ... ok
tests/ui/duration_suboptimal_units.rs ... ok
tests/ui/duration_subsec.rs ... ok
tests/ui/duration_suboptimal_units_days_weeks.fixed ... ok
tests/ui/duration_suboptimal_units.fixed ... ok
tests/ui/duration_subsec.fixed ... ok
tests/ui/eager_transmute.rs ... ok
tests/ui/empty_docs.rs ... ok
tests/ui/elidable_lifetime_names.rs ... ok
tests/ui/else_if_without_else.rs ... ok
---
tests/ui/should_impl_trait/method_list_2.rs (revision `edition2015`) ... ok
tests/ui/should_impl_trait/method_list_2.rs (revision `edition2021`) ... ok

FAILED TEST: tests/ui/future_not_send.rs
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/future_not_send.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-ee7a2784b8022f9b.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-ee7a2784b8022f9b.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"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/future_not_send.stderr` to the actual output
--- tests/ui/future_not_send.stderr
+++ <stderr output>
-error: future cannot be sent between threads safely
-  --> tests/ui/future_not_send.rs:8:62
-   |
-LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
-   |                                                              ^^^^ future returned by `private_future` is not `Send`
-   |
-note: future is not `Send` as this value is used across an await
-  --> tests/ui/future_not_send.rs:11:20
-   |
-LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
-   |                         -- has type `std::rc::Rc<[u8]>` which is not `Send`
-...
-LL |     async { true }.await
-   |                    ^^^^^ await occurs here, with `rc` maybe used later
-   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
-note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
-  --> tests/ui/future_not_send.rs:8:39
-   |
-LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
-   |                                       ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
-   = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
-   = note: `-D clippy::future-not-send` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
 
-error: future cannot be sent between threads safely
-  --> tests/ui/future_not_send.rs:14:41
-   |
-LL | pub async fn public_future(rc: Rc<[u8]>) {
-   |                                         ^ future returned by `public_future` is not `Send`
-   |
-note: future is not `Send` as this value is used across an await
-  --> tests/ui/future_not_send.rs:17:20
-   |
-LL | pub async fn public_future(rc: Rc<[u8]>) {
-   |                            -- has type `std::rc::Rc<[u8]>` which is not `Send`
-...
-LL |     async { true }.await;
-   |                    ^^^^^ await occurs here, with `rc` maybe used later
-   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
+thread 'rustc' (52567) panicked at compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs:2666:57:
+called `Option::unwrap()` on a `None` value
+stack backtrace:
+   0: __rustc::rust_begin_unwind
+   1: core::panicking::panic_fmt
+   2: core::panicking::panic
+   3: core::option::unwrap_failed
+   4: <rustc_trait_selection::error_reporting::TypeErrCtxt>::maybe_note_obligation_cause_for_async_await::<()>
+   5: <clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}> as rustc_errors::diagnostic::Diagnostic<()>>::into_diag
+   6: <rustc_middle::lint::diag_lint_level<clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}>>::{closure#0} as core::ops::function::FnOnce<(rustc_errors::DiagCtxtHandle, rustc_errors::Level)>>::call_once::{shim:vtable#0}
+   7: rustc_middle::lint::diag_lint_level::diag_lint_level_impl
+   8: rustc_middle::lint::diag_lint_level::<clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}>>
+   9: <rustc_lint::context::LateContext as rustc_lint::context::LintContext>::opt_span_diag_lint::<rustc_span::span_encoding::Span, clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}>>
+  10: <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn
+  11: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_fn
+  12: rustc_hir::intravisit::walk_item::<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
+  13: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_item
+  14: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_mod
+  15: rustc_lint::late::late_lint_crate
+  16: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_lint::late::check_crate::{closure#0}>>
---
+  21: rustc_interface::passes::analysis::{closure#0}::{closure#0}
+  22: rustc_data_structures::sync::parallel::par_fns
+  23: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#0}>
+  24: rustc_interface::passes::analysis
+      [... omitted 1 frame ...]
+  25: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
+  26: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
+  27: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
+  28: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
+  29: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
+  30: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
+note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
 
-error: future cannot be sent between threads safely
-  --> tests/ui/future_not_send.rs:24:63
-   |
-LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
-   |                                                               ^^^^ future returned by `private_future2` is not `Send`
-   |
-note: captured value is not `Send`
-  --> tests/ui/future_not_send.rs:24:26
-   |
-LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
-   |                          ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
-   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
-note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
-  --> tests/ui/future_not_send.rs:24:40
-   |
-LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
-   |                                        ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
-   = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
+error: the compiler unexpectedly panicked. This is a bug
 
-error: future cannot be sent between threads safely
-  --> tests/ui/future_not_send.rs:30:42
-   |
-LL | pub async fn public_future2(rc: Rc<[u8]>) {}
-   |                                          ^ future returned by `public_future2` is not `Send`
-   |
-note: captured value is not `Send`
-  --> tests/ui/future_not_send.rs:30:29
-   |
-LL | pub async fn public_future2(rc: Rc<[u8]>) {}
-   |                             ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
-   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
+note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new?template=ice.yml
 
-error: future cannot be sent between threads safely
-  --> tests/ui/future_not_send.rs:42:39
-   |
-LL |     async fn private_future(&self) -> usize {
-   |                                       ^^^^^ future returned by `private_future` is not `Send`
-   |
-note: future is not `Send` as this value is used across an await
-  --> tests/ui/future_not_send.rs:45:24
-   |
-LL |     async fn private_future(&self) -> usize {
-   |                             ----- has type `&Dummy` which is not `Send`
-...
-LL |         async { true }.await;
-   |                        ^^^^^ await occurs here, with `&self` maybe used later
-   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
+note: please make sure that you have updated to the latest nightly
 
-error: future cannot be sent between threads safely
-  --> tests/ui/future_not_send.rs:49:38
-   |
-LL |     pub async fn public_future(&self) {
-   |                                      ^ future returned by `public_future` is not `Send`
-   |
-note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
-  --> tests/ui/future_not_send.rs:49:32
-   |
-LL |     pub async fn public_future(&self) {
-   |                                ^^^^^ has type `&Dummy` which is not `Send`, because `Dummy` is not `Sync`
-   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
+note: rustc 1.96.0-nightly (71b848a5f 2026-03-05) running on x86_64-unknown-linux-gnu
 
-error: future cannot be sent between threads safely
-  --> tests/ui/future_not_send.rs:61:37
-   |
-LL | async fn generic_future<T>(t: T) -> T
-   |                                     ^ future returned by `generic_future` is not `Send`
-   |
-note: future is not `Send` as this value is used across an await
-  --> tests/ui/future_not_send.rs:67:20
-   |
-LL |     let rt = &t;
-   |         -- has type `&T` which is not `Send`
-LL |     async { true }.await;
-   |                    ^^^^^ await occurs here, with `rt` maybe used later
-   = note: `T` doesn't implement `std::marker::Sync`
+note: compiler flags: -Z ui-testing -Z deduplicate-diagnostics=no
 
-error: future cannot be sent between threads safely
-  --> tests/ui/future_not_send.rs:83:51
-   |
-LL | async fn generic_future_always_unsend<T>(_: Rc<T>) {
-   |                                                   ^ future returned by `generic_future_always_unsend` is not `Send`
-   |
-note: future is not `Send` as this value is used across an await
-  --> tests/ui/future_not_send.rs:86:20
-   |
-LL | async fn generic_future_always_unsend<T>(_: Rc<T>) {
-   |                                          - has type `std::rc::Rc<T>` which is not `Send`
-...
-LL |     async { true }.await;
-   |                    ^^^^^ await occurs here, with `_` maybe used later
-   = note: `std::rc::Rc<T>` doesn't implement `std::marker::Send`
+query stack during panic:
+#0 [analysis] running analysis passes on crate `future_not_send`
+end of query stack
+note: Clippy version: clippy 0.1.95 (71b848a5f6 2026-03-05)
---
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: <rustc_trait_selection::error_reporting::TypeErrCtxt>::maybe_note_obligation_cause_for_async_await::<()>
   5: <clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}> as rustc_errors::diagnostic::Diagnostic<()>>::into_diag
   6: <rustc_middle::lint::diag_lint_level<clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}>>::{closure#0} as core::ops::function::FnOnce<(rustc_errors::DiagCtxtHandle, rustc_errors::Level)>>::call_once::{shim:vtable#0}
   7: rustc_middle::lint::diag_lint_level::diag_lint_level_impl
   8: rustc_middle::lint::diag_lint_level::<clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}>>
   9: <rustc_lint::context::LateContext as rustc_lint::context::LintContext>::opt_span_diag_lint::<rustc_span::span_encoding::Span, clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}>>
  10: <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn
  11: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_fn
  12: rustc_hir::intravisit::walk_item::<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
  13: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_item
  14: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_mod
  15: rustc_lint::late::late_lint_crate
  16: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_lint::late::check_crate::{closure#0}>>
---
  21: rustc_interface::passes::analysis::{closure#0}::{closure#0}
  22: rustc_data_structures::sync::parallel::par_fns
  23: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#0}>
  24: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  25: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  26: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
  27: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  28: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
  29: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
  30: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: <rustc_trait_selection::error_reporting::TypeErrCtxt>::maybe_note_obligation_cause_for_async_await::<()>
   5: <clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}> as rustc_errors::diagnostic::Diagnostic<()>>::into_diag
   6: <rustc_middle::lint::diag_lint_level<clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}>>::{closure#0} as core::ops::function::FnOnce<(rustc_errors::DiagCtxtHandle, rustc_errors::Level)>>::call_once::{shim:vtable#0}
   7: rustc_middle::lint::diag_lint_level::diag_lint_level_impl
   8: rustc_middle::lint::diag_lint_level::<clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}>>
   9: <rustc_lint::context::LateContext as rustc_lint::context::LintContext>::opt_span_diag_lint::<rustc_span::span_encoding::Span, clippy_utils::diagnostics::span_lint_and_then::ClippyDiag<clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, &str, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#3}>::{closure#0}>>
  10: <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn
  11: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_fn
  12: rustc_hir::intravisit::walk_item::<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
  13: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_item
  14: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_mod
  15: rustc_lint::late::late_lint_crate
  16: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_lint::late::check_crate::{closure#0}>>
---
  21: rustc_interface::passes::analysis::{closure#0}::{closure#0}
  22: rustc_data_structures::sync::parallel::par_fns
  23: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#0}>
  24: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  25: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  26: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
  27: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  28: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
  29: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
  30: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---



FAILED TEST: tests/ui/track-diagnostics-clippy.rs
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/track-diagnostics-clippy.rs" "-Z" "track-diagnostics" "--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-ee7a2784b8022f9b.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-ee7a2784b8022f9b.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"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/track-diagnostics-clippy.stderr` to the actual output
--- tests/ui/track-diagnostics-clippy.stderr
+++ <stderr output>
 error: casting to the same type is unnecessary (`u32` -> `u32`)
   --> tests/ui/track-diagnostics-clippy.rs:LL:CC
... 2 lines skipped ...
    |             ^^^^^^^^ help: try: `a`
    |

---
... 18 lines skipped ...
 error: aborting due to 2 previous errors
 

Full unnormalized output:
error: casting to the same type is unnecessary (`u32` -> `u32`)
##[error]  --> tests/ui/track-diagnostics-clippy.rs:13:13
   |
LL |     let b = a as u32;
   |             ^^^^^^^^ help: try: `a`
   |
---



full stderr:
error: casting to the same type is unnecessary (`u32` -> `u32`)
##[error]  --> tests/ui/track-diagnostics-clippy.rs:13:13
   |
LL |     let b = a as u32;
   |             ^^^^^^^^ help: try: `a`
   |

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants