Skip to content

[ICE]: Bug when compiling simple example but with error. #159361

Description

@dmalkr

Code

use axum::extract::State;
use axum::http::StatusCode;
use axum::response::{IntoResponse, Response};
use axum::routing::get;
use prometheus_client::registry::Registry;
use std::sync::Arc;
use tokio::sync::Mutex;

#[derive(Clone, Debug, Hash, PartialEq, Eq, EncodeLabelValue)]
pub enum Method {
    Get,
    Post,
}

#[derive(Clone, Debug, Hash, PartialEq, Eq, EncodeLabelSet)]
pub struct MethodLabels {
    pub method: Method,
}

#[derive(Debug)]
pub struct Metrics {
    requests: Family<MethodLabels, Counter>,
    other_requests: Family<MethodLabels, Counter>,
}

#[derive(Debug)]
pub struct AppState {
    pub registry: Registry,
}

pub async fn metrics_handler(State(state): State<Arc<Mutex<AppState>>>) -> impl IntoResponse {
    todo!()
}


#[tokio::main]
async fn main() {
    state
        .registry
        .register("requests", "Count of requests", metrics.requests.clone())
        .register("other_requests", "Count of other requests", metrics.other_requests.clone());
    let metrics = Arc::new(Mutex::new(metrics));
    let state = Arc::new(Mutex::new(state));

    let router = Router::new()
        .route("/metrics", get(metrics_handler))
        .with_state(state)
        ;
    let port = 8080;
    let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{port}"))
        .await
        .unwrap();

    axum::serve(listener, router).await.unwrap();
}

Meta

rustc --version --verbose:

rustc 1.99.0-nightly (f10db292a 2026-07-07)
binary: rustc
commit-hash: f10db292a3733b5c67c8da8c7661195ff4b05774
commit-date: 2026-07-07
host: x86_64-unknown-linux-gnu
release: 1.99.0-nightly
LLVM version: 22.1.8

Error output

   Compiling node-backend-rust v0.1.0 (/home/dima/dz-far-node/node-backend-rust)
error: cannot find derive macro `EncodeLabelValue` in this scope
 --> src/main.rs:9:45
  |
9 | #[derive(Clone, Debug, Hash, PartialEq, Eq, EncodeLabelValue)]
  |                                             ^^^^^^^^^^^^^^^^
  |
help: consider importing one of these derive macros
  |
1 + use prometheus_client::encoding::EncodeLabelValue;
  |
1 + use prometheus_client_derive_encode::EncodeLabelValue;
  |

error: cannot find derive macro `EncodeLabelSet` in this scope
  --> src/main.rs:15:45
   |
15 | #[derive(Clone, Debug, Hash, PartialEq, Eq, EncodeLabelSet)]
   |                                             ^^^^^^^^^^^^^^
   |
help: consider importing one of these derive macros
   |
 1 + use prometheus_client::encoding::EncodeLabelSet;
   |
 1 + use prometheus_client_derive_encode::EncodeLabelSet;
   |

error[E0425]: cannot find type `Family` in this scope
  --> src/main.rs:22:15
   |
22 |     requests: Family<MethodLabels, Counter>,
   |               ^^^^^^ not found in this scope
   |
help: consider importing this struct
   |
 1 + use prometheus_client::metrics::family::Family;
   |

error[E0425]: cannot find type `Counter` in this scope
  --> src/main.rs:22:36
   |
22 |     requests: Family<MethodLabels, Counter>,
   |                                    ^^^^^^^ not found in this scope
   |
help: consider importing this struct
   |
 1 + use prometheus_client::metrics::counter::Counter;
   |

error[E0425]: cannot find type `Family` in this scope
  --> src/main.rs:23:21
   |
23 |     other_requests: Family<MethodLabels, Counter>,
   |                     ^^^^^^ not found in this scope
   |
help: consider importing this struct
   |
 1 + use prometheus_client::metrics::family::Family;
   |

error[E0425]: cannot find type `Counter` in this scope
  --> src/main.rs:23:42
   |
23 |     other_requests: Family<MethodLabels, Counter>,
   |                                          ^^^^^^^ not found in this scope
   |
help: consider importing this struct
   |
 1 + use prometheus_client::metrics::counter::Counter;
   |

error[E0425]: cannot find value `state` in this scope
   --> src/main.rs:38:5
    |
 38 |     state
    |     ^^^^^
    |
   ::: /home/dima/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/axum-0.8.9/src/extract/state.rs:301:1
    |
301 | pub struct State<S>(pub S);
    | ------------------- similarly named tuple struct `State` defined here
    |
help: a tuple struct with a similar name exists (notice the capitalization)
    |
 38 -     state
 38 +     State
    |

error[E0425]: cannot find value `metrics` in this scope
  --> src/main.rs:40:52
   |
40 |         .register("requests", "Count of requests", metrics.requests.clone())
   |                                                    ^^^^^^^ not found in this scope

error[E0425]: cannot find value `metrics` in this scope
  --> src/main.rs:41:64
   |
41 |         .register("other_requests", "Count of other requests", metrics.other_requests.clone());
   |                                                                ^^^^^^^ not found in this scope

error[E0425]: cannot find value `metrics` in this scope
  --> src/main.rs:42:39
   |
42 |     let metrics = Arc::new(Mutex::new(metrics));
   |                                       ^^^^^^^ not found in this scope

error[E0425]: cannot find value `state` in this scope
   --> src/main.rs:43:37
    |
 43 |     let state = Arc::new(Mutex::new(state));
    |                                     ^^^^^
    |
   ::: /home/dima/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/axum-0.8.9/src/extract/state.rs:301:1
    |
301 | pub struct State<S>(pub S);
    | ------------------- similarly named tuple struct `State` defined here
    |
help: a tuple struct with a similar name exists (notice the capitalization)
    |
 43 -     let state = Arc::new(Mutex::new(state));
 43 +     let state = Arc::new(Mutex::new(State));
    |

error[E0433]: cannot find type `Router` in this scope
  --> src/main.rs:45:18
   |
45 |     let router = Router::new()
   |                  ^^^^^^ use of undeclared type `Router`
   |
help: consider importing this struct
   |
 1 + use axum::Router;
   |

warning: unused import: `axum::http::StatusCode`
 --> src/main.rs:2:5
  |
2 | use axum::http::StatusCode;
  |     ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

warning: unused import: `Response`
 --> src/main.rs:3:36
  |
3 | use axum::response::{IntoResponse, Response};
  |                                    ^^^^^^^^

error[E0277]: the trait bound `!: IntoResponse` is not satisfied
  --> src/main.rs:31:94
   |
31 |   pub async fn metrics_handler(State(state): State<Arc<Mutex<AppState>>>) -> impl IntoResponse {
   |  ______________________________________________________________________________________________^
32 | |     todo!()
33 | | }
   | | ^
   | | |
   | |_the trait `IntoResponse` is not implemented for `!`
   |   return type was inferred to be `_` here
   |
   = help: the following other types implement trait `IntoResponse`:
             &'static [u8; N]
             &'static [u8]
             &'static str
             ()
             (R,)
             (Response<()>, R)
             (Response<()>, T1, R)
             (Response<()>, T1, T2, R)
           and 120 others
   = 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

error[E0277]: the trait bound `!: IntoResponse` is not satisfied
  --> src/main.rs:31:76
   |
31 | pub async fn metrics_handler(State(state): State<Arc<Mutex<AppState>>>) -> impl IntoResponse {
   |                                                                            ^^^^^^^^^^^^^^^^^ the trait `IntoResponse` is not implemented for `!`
   |
   = help: the following other types implement trait `IntoResponse`:
             &'static [u8; N]
             &'static [u8]
             &'static str
             ()
             (R,)
             (Response<()>, R)
             (Response<()>, T1, R)
             (Response<()>, T1, T2, R)
           and 120 others
   = 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

error: internal compiler error: encountered incremental compilation error with evaluate_obligation(968b210fc9b39212-fa93616bd80decf2)
  |
  = note: please follow the instructions below to create a bug report with the provided information
  = note: for incremental compilation bugs, having a reproduction is vital
  = note: an ideal reproduction consists of the code before and some patch that then triggers the bug when applied and compiled again
  = note: as a workaround, you can run `cargo clean -p node_backend_rust` or `cargo clean` to allow your project to compile


thread 'rustc' (108549) panicked at /rustc-dev/f10db292a3733b5c67c8da8c7661195ff4b05774/compiler/rustc_middle/src/verify_ich.rs:82:9:
Found unstable fingerprints for evaluate_obligation(968b210fc9b39212-fa93616bd80decf2): Ok(EvaluatedToOk)
stack backtrace:
   0:     0x7f2ee42d4756 - <<std[6a054115ba3acc4c]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[aee49dcb9b368417]::fmt::Display>::fmt
   1:     0x7f2ee4a0f108 - core[aee49dcb9b368417]::fmt::write
   2:     0x7f2ee42e9b3c - <std[6a054115ba3acc4c]::sys::stdio::unix::Stderr as std[6a054115ba3acc4c]::io::Write>::write_fmt
   3:     0x7f2ee42a8bba - std[6a054115ba3acc4c]::panicking::default_hook::{closure#0}
   4:     0x7f2ee42c6ea3 - std[6a054115ba3acc4c]::panicking::default_hook
   5:     0x7f2ee32b6de8 - std[6a054115ba3acc4c]::panicking::update_hook::<alloc[cf2cab0bb0196a67]::boxed::Box<rustc_driver_impl[577425067c9284f5]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7f2ee42c7342 - std[6a054115ba3acc4c]::panicking::panic_with_hook
   7:     0x7f2ee42a8c72 - std[6a054115ba3acc4c]::panicking::panic_handler::{closure#0}
   8:     0x7f2ee429d159 - std[6a054115ba3acc4c]::sys::backtrace::__rust_end_short_backtrace::<std[6a054115ba3acc4c]::panicking::panic_handler::{closure#0}, !>
   9:     0x7f2ee42aa5dd - __rustc[9621d9ded71cae34]::rust_begin_unwind
  10:     0x7f2ee14781ac - core[aee49dcb9b368417]::panicking::panic_fmt
  11:     0x7f2ee3897dd6 - rustc_middle[92ea5bf5081796f]::verify_ich::incremental_verify_ich_failed
  12:     0x7f2ee4f05c5a - rustc_middle[92ea5bf5081796f]::verify_ich::incremental_verify_ich::<rustc_middle[92ea5bf5081796f]::query::erase::ErasedData<[u8; 2usize]>>
  13:     0x7f2ee57882d5 - rustc_query_impl[e9b1f27d4db47a3a]::execution::try_execute_query::<rustc_middle[92ea5bf5081796f]::query::caches::DefaultCache<rustc_type_ir[34efbddc4bb4c86b]::canonical::CanonicalQueryInput<rustc_middle[92ea5bf5081796f]::ty::context::TyCtxt, rustc_middle[92ea5bf5081796f]::ty::ParamEnvAnd<rustc_middle[92ea5bf5081796f]::ty::predicate::Predicate>>, rustc_middle[92ea5bf5081796f]::query::erase::ErasedData<[u8; 2usize]>>, true>
  14:     0x7f2ee5786b9c - rustc_query_impl[e9b1f27d4db47a3a]::query_impl::evaluate_obligation::execute_query_incr::__rust_end_short_backtrace
  15:     0x7f2ee50b996c - <rustc_trait_selection[9dec3829e28c37de]::traits::fulfill::FulfillProcessor as rustc_data_structures[7bb7b8ba950b54e3]::obligation_forest::ObligationProcessor>::process_obligation
  16:     0x7f2ee4a05c51 - <rustc_data_structures[7bb7b8ba950b54e3]::obligation_forest::ObligationForest<rustc_trait_selection[9dec3829e28c37de]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[9dec3829e28c37de]::traits::fulfill::FulfillProcessor>
  17:     0x7f2ee4cf7a0a - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_call
  18:     0x7f2ee4cd65d3 - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  19:     0x7f2ee4c7dbd7 - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_argument_types
  20:     0x7f2ee4cbd0fb - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_method_call
  21:     0x7f2ee4cd6580 - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  22:     0x7f2ee4cbb652 - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_method_call
  23:     0x7f2ee4cd6580 - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  24:     0x7f2ee4ca0e84 - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_decl
  25:     0x7f2ee4cacd6c - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_block
  26:     0x7f2ee4cd65ad - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27:     0x7f2ee4c8d54c - rustc_hir_typeck[9ea7d76595b24fb]::check::check_fn
  28:     0x7f2ee562fd71 - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_closure
  29:     0x7f2ee4cda2a2 - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  30:     0x7f2ee4ca0e84 - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_decl
  31:     0x7f2ee4cacd6c - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_block
  32:     0x7f2ee4cd65ad - <rustc_hir_typeck[9ea7d76595b24fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33:     0x7f2ee4c8d54c - rustc_hir_typeck[9ea7d76595b24fb]::check::check_fn
  34:     0x7f2ee5808281 - rustc_hir_typeck[9ea7d76595b24fb]::typeck_with_inspect::{closure#0}
  35:     0x7f2ee5806c80 - rustc_query_impl[e9b1f27d4db47a3a]::query_impl::typeck_root::invoke_provider_fn::__rust_begin_short_backtrace
  36:     0x7f2ee4dbde31 - rustc_query_impl[e9b1f27d4db47a3a]::execution::try_execute_query::<rustc_data_structures[7bb7b8ba950b54e3]::vec_cache::VecCache<rustc_span[c5df0340e99405a0]::def_id::LocalDefId, rustc_middle[92ea5bf5081796f]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[92ea5bf5081796f]::dep_graph::graph::DepNodeIndex>, true>
  37:     0x7f2ee4dbd2ae - rustc_query_impl[e9b1f27d4db47a3a]::query_impl::typeck_root::execute_query_incr::__rust_end_short_backtrace
  38:     0x7f2ee5061cd9 - <rustc_middle[92ea5bf5081796f]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[7e4c84d427bc2bf1]::check_crate::{closure#1}>::{closure#0}
  39:     0x7f2ee50615f9 - rustc_hir_analysis[7e4c84d427bc2bf1]::check_crate
  40:     0x7f2ee51d177a - rustc_interface[c0e9a927cec1dd04]::passes::analysis
  41:     0x7f2ee5c1c8c3 - rustc_query_impl[e9b1f27d4db47a3a]::execution::try_execute_query::<rustc_middle[92ea5bf5081796f]::query::caches::SingleCache<rustc_middle[92ea5bf5081796f]::query::erase::ErasedData<[u8; 0usize]>>, true>
  42:     0x7f2ee5c1c1f7 - rustc_query_impl[e9b1f27d4db47a3a]::query_impl::analysis::execute_query_incr::__rust_end_short_backtrace
  43:     0x7f2ee5ba37c0 - rustc_interface[c0e9a927cec1dd04]::interface::run_compiler::<(), rustc_driver_impl[577425067c9284f5]::run_compiler::{closure#0}>::{closure#1}
  44:     0x7f2ee5b825fa - std[6a054115ba3acc4c]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[c0e9a927cec1dd04]::util::run_in_thread_with_globals<rustc_interface[c0e9a927cec1dd04]::util::run_in_thread_pool_with_globals<rustc_interface[c0e9a927cec1dd04]::interface::run_compiler<(), rustc_driver_impl[577425067c9284f5]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  45:     0x7f2ee5b823ad - <std[6a054115ba3acc4c]::thread::lifecycle::spawn_unchecked<rustc_interface[c0e9a927cec1dd04]::util::run_in_thread_with_globals<rustc_interface[c0e9a927cec1dd04]::util::run_in_thread_pool_with_globals<rustc_interface[c0e9a927cec1dd04]::interface::run_compiler<(), rustc_driver_impl[577425067c9284f5]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[aee49dcb9b368417]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  46:     0x7f2ee5b867d0 - <std[6a054115ba3acc4c]::sys::thread::unix::Thread>::new::thread_start
  47:     0x7f2edf6bbcdd - <unknown>
  48:     0x7f2edf72d8bc - <unknown>
  49:                0x0 - <unknown>

error: the compiler unexpectedly panicked. This is a bug

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/dima/dz-far-node/node-backend-rust/rustc-ice-2026-07-16T05_58_45-108547.txt` to your bug report

note: rustc 1.99.0-nightly (f10db292a 2026-07-07) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `alloc::vec::Vec<prometheus_client::registry::Registry>: core::marker::Send`
#1 [typeck_root] type-checking `main`
... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
Some errors have detailed explanations: E0277, E0425, E0433.
For more information about an error, try `rustc --explain E0277`.
warning: `node-backend-rust` (bin "node-backend-rust") generated 2 warnings
error: could not compile `node-backend-rust` (bin "node-backend-rust") due to 15 previous errors; 2 warnings emitted
Backtrace

   Compiling node-backend-rust v0.1.0 (/home/dima/dz-far-node/node-backend-rust)
error: cannot find derive macro `EncodeLabelValue` in this scope
 --> src/main.rs:9:45
  |
9 | #[derive(Clone, Debug, Hash, PartialEq, Eq, EncodeLabelValue)]
  |                                             ^^^^^^^^^^^^^^^^
  |
help: consider importing one of these derive macros
  |
1 + use prometheus_client::encoding::EncodeLabelValue;
  |
1 + use prometheus_client_derive_encode::EncodeLabelValue;
  |

error: cannot find derive macro `EncodeLabelSet` in this scope
  --> src/main.rs:15:45
   |
15 | #[derive(Clone, Debug, Hash, PartialEq, Eq, EncodeLabelSet)]
   |                                             ^^^^^^^^^^^^^^
   |
help: consider importing one of these derive macros
   |
 1 + use prometheus_client::encoding::EncodeLabelSet;
   |
 1 + use prometheus_client_derive_encode::EncodeLabelSet;
   |

error[E0425]: cannot find type `Family` in this scope
  --> src/main.rs:22:15
   |
22 |     requests: Family<MethodLabels, Counter>,
   |               ^^^^^^ not found in this scope
   |
help: consider importing this struct
   |
 1 + use prometheus_client::metrics::family::Family;
   |

error[E0425]: cannot find type `Counter` in this scope
  --> src/main.rs:22:36
   |
22 |     requests: Family<MethodLabels, Counter>,
   |                                    ^^^^^^^ not found in this scope
   |
help: consider importing this struct
   |
 1 + use prometheus_client::metrics::counter::Counter;
   |

error[E0425]: cannot find type `Family` in this scope
  --> src/main.rs:23:21
   |
23 |     other_requests: Family<MethodLabels, Counter>,
   |                     ^^^^^^ not found in this scope
   |
help: consider importing this struct
   |
 1 + use prometheus_client::metrics::family::Family;
   |

error[E0425]: cannot find type `Counter` in this scope
  --> src/main.rs:23:42
   |
23 |     other_requests: Family<MethodLabels, Counter>,
   |                                          ^^^^^^^ not found in this scope
   |
help: consider importing this struct
   |
 1 + use prometheus_client::metrics::counter::Counter;
   |

error[E0425]: cannot find value `state` in this scope
   --> src/main.rs:38:5
    |
 38 |     state
    |     ^^^^^
    |
   ::: /home/dima/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/axum-0.8.9/src/extract/state.rs:301:1
    |
301 | pub struct State<S>(pub S);
    | ------------------- similarly named tuple struct `State` defined here
    |
help: a tuple struct with a similar name exists (notice the capitalization)
    |
 38 -     state
 38 +     State
    |

error[E0425]: cannot find value `metrics` in this scope
  --> src/main.rs:40:52
   |
40 |         .register("requests", "Count of requests", metrics.requests.clone())
   |                                                    ^^^^^^^ not found in this scope

error[E0425]: cannot find value `metrics` in this scope
  --> src/main.rs:41:64
   |
41 |         .register("other_requests", "Count of other requests", metrics.other_requests.clone());
   |                                                                ^^^^^^^ not found in this scope

error[E0425]: cannot find value `metrics` in this scope
  --> src/main.rs:42:39
   |
42 |     let metrics = Arc::new(Mutex::new(metrics));
   |                                       ^^^^^^^ not found in this scope

error[E0425]: cannot find value `state` in this scope
   --> src/main.rs:43:37
    |
 43 |     let state = Arc::new(Mutex::new(state));
    |                                     ^^^^^
    |
   ::: /home/dima/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/axum-0.8.9/src/extract/state.rs:301:1
    |
301 | pub struct State<S>(pub S);
    | ------------------- similarly named tuple struct `State` defined here
    |
help: a tuple struct with a similar name exists (notice the capitalization)
    |
 43 -     let state = Arc::new(Mutex::new(state));
 43 +     let state = Arc::new(Mutex::new(State));
    |

error[E0433]: cannot find type `Router` in this scope
  --> src/main.rs:45:18
   |
45 |     let router = Router::new()
   |                  ^^^^^^ use of undeclared type `Router`
   |
help: consider importing this struct
   |
 1 + use axum::Router;
   |

warning: unused import: `axum::http::StatusCode`
 --> src/main.rs:2:5
  |
2 | use axum::http::StatusCode;
  |     ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

warning: unused import: `Response`
 --> src/main.rs:3:36
  |
3 | use axum::response::{IntoResponse, Response};
  |                                    ^^^^^^^^

error[E0277]: the trait bound `!: IntoResponse` is not satisfied
  --> src/main.rs:31:94
   |
31 |   pub async fn metrics_handler(State(state): State<Arc<Mutex<AppState>>>) -> impl IntoResponse {
   |  ______________________________________________________________________________________________^
32 | |     todo!()
33 | | }
   | | ^
   | | |
   | |_the trait `IntoResponse` is not implemented for `!`
   |   return type was inferred to be `_` here
   |
   = help: the following other types implement trait `IntoResponse`:
             &'static [u8; N]
             &'static [u8]
             &'static str
             ()
             (R,)
             (Response<()>, R)
             (Response<()>, T1, R)
             (Response<()>, T1, T2, R)
           and 120 others
   = 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

error[E0277]: the trait bound `!: IntoResponse` is not satisfied
  --> src/main.rs:31:76
   |
31 | pub async fn metrics_handler(State(state): State<Arc<Mutex<AppState>>>) -> impl IntoResponse {
   |                                                                            ^^^^^^^^^^^^^^^^^ the trait `IntoResponse` is not implemented for `!`
   |
   = help: the following other types implement trait `IntoResponse`:
             &'static [u8; N]
             &'static [u8]
             &'static str
             ()
             (R,)
             (Response<()>, R)
             (Response<()>, T1, R)
             (Response<()>, T1, T2, R)
           and 120 others
   = 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

error: internal compiler error: encountered incremental compilation error with evaluate_obligation(968b210fc9b39212-fa93616bd80decf2)
  |
  = note: please follow the instructions below to create a bug report with the provided information
  = note: for incremental compilation bugs, having a reproduction is vital
  = note: an ideal reproduction consists of the code before and some patch that then triggers the bug when applied and compiled again
  = note: as a workaround, you can run `cargo clean -p node_backend_rust` or `cargo clean` to allow your project to compile


thread 'rustc' (108976) panicked at /rustc-dev/f10db292a3733b5c67c8da8c7661195ff4b05774/compiler/rustc_middle/src/verify_ich.rs:82:9:
Found unstable fingerprints for evaluate_obligation(968b210fc9b39212-fa93616bd80decf2): Ok(EvaluatedToOk)
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_middle::verify_ich::incremental_verify_ich_failed
   3: rustc_middle::verify_ich::incremental_verify_ich::<rustc_middle::query::erase::ErasedData<[u8; 2]>>
   4: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::DefaultCache<rustc_type_ir::canonical::CanonicalQueryInput<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::predicate::Predicate>>, rustc_middle::query::erase::ErasedData<[u8; 2]>>, true>
   5: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
   6: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
   7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_call
   8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
   9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_method_call
  11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_method_call
  13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
  15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_block
  16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  17: rustc_hir_typeck::check::check_fn
  18: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_closure
  19: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  20: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
  21: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_block
  22: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23: rustc_hir_typeck::check::check_fn
  24: rustc_hir_typeck::typeck_with_inspect::{closure#0}
      [... omitted 1 frame ...]
  25: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis::check_crate::{closure#1}>::{closure#0}
  26: rustc_hir_analysis::check_crate
  27: rustc_interface::passes::analysis
  28: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 0]>>, true>
  29: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. This is a bug

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/dima/dz-far-node/node-backend-rust/rustc-ice-2026-07-16T06_00_55-108974.txt` to your bug report

note: rustc 1.99.0-nightly (f10db292a 2026-07-07) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `alloc::vec::Vec<prometheus_client::registry::Registry>: core::marker::Send`
#1 [typeck_root] type-checking `main`
#2 [analysis] running analysis passes on crate `node_backend_rust`
end of query stack
Some errors have detailed explanations: E0277, E0425, E0433.
For more information about an error, try `rustc --explain E0277`.
warning: `node-backend-rust` (bin "node-backend-rust") generated 2 warnings
error: could not compile `node-backend-rust` (bin "node-backend-rust") due to 15 previous errors; 2 warnings emitted

[rustc-ice-2026-07-16T06_00_55-108974.txt](https://github.com/user-attachments/files/30075834/rustc-ice-2026-07-16T06_00_55-108974.txt)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions