Skip to content

ICE: unhandled node ConstArg(ConstArg  #143358

Open
@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

#![feature(generic_const_exprs)]
#![feature(min_generic_const_args)]


const fn identity<const T: identity::<{ identity::<{ identity::<{ identity::<{ /**...*/ }> }>() }>() }>>() -> u32 {  }

#[derive(, , )]
pub struct ConstU32<const U: identity>;

pub fn new() -> ConstU32<{ u32() }> {
  
}

fn iv() {
  let iv = ();
  assert_eq!;
}

original:

// run-pass

const fn identity<const T: identity::<{ identity::<{ identity::<{ identity::<{ /**...*/identity::<3>() }> }>() }>() }>>() -> u32 { identity::<{ identity::<{ u32::<{ identity::<{ /**...*/identity::<3>() }>() }>() }>() }> }

#[derive(Eq, PartialEq, Debug)]
pub struct ConstU32<const U: identity>;

pub fn new() -> ConstU32<{ u32() }> {
  ConstU32::<{ identity::<{ identity::<{ identity::<{ identity::<{ /**...*/identity::<3>() }> }>() }>() }>() }>
}

fn iv() {
  let iv = identity::<3>();
  assert_eq!(v, ConstU32::<3>);
}

Version information

rustc 1.90.0-nightly (6268d0aa3 2025-07-03)
binary: rustc
commit-hash: 6268d0aa34b46981533b09827c1454b8cf27e032
commit-date: 2025-07-03
host: x86_64-unknown-linux-gnu
release: 1.90.0-nightly
LLVM version: 20.1.7

Possibly related line of code:

Node::Synthetic => span_bug!(
tcx.def_span(def_id),
"synthetic HIR should have its `generics_of` explicitly fed"
),
_ => span_bug!(tcx.def_span(def_id), "unhandled node {node:?}"),
};
enum Defaults {
Allowed,
// See #36887
FutureCompatDisallowed,

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zcrate-attr=feature(generic_const_exprs) -Zcrate-attr=feature(min_generic_const_args)

Program output

error[E0585]: found a documentation comment that doesn't document anything
 --> /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:3:80
  |
3 | const fn identity<const T: identity::<{ identity::<{ identity::<{ identity::<{ /**...*/ }> }>() }>() }>>() -> u32 {  }
  |                                                                                ^^^^^^^^
  |
  = help: doc comments must come before what they document, if a comment was intended use `//`

error: expected one of `(`, `[`, or `{`, found `;`
  --> /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:14:13
   |
14 |   assert_eq!;
   |             ^ expected one of `(`, `[`, or `{`

error: expected unsuffixed literal, found `,`
 --> /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:5:10
  |
5 | #[derive(, , )]
  |          ^

error[E0573]: expected type, found function `identity`
 --> /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:3:28
  |
3 | const fn identity<const T: identity::<{ identity::<{ identity::<{ identity::<{ /**...*/ }> }>() }>() }>>() -> u32 {  }
  |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type

error[E0573]: expected type, found function `identity`
 --> /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:6:30
  |
6 | pub struct ConstU32<const U: identity>;
  |                              ^^^^^^^^ not a type

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> <crate attribute>:1:12
  |
1 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes
 --> <crate attribute>:1:12
  |
1 | #![feature(min_generic_const_args)]
  |            ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information

error[E0601]: `main` function not found in crate `mvce`
  --> /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:15:2
   |
15 | }
   |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs`

error[E0423]: expected function, found builtin type `u32`
 --> /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:8:28
  |
8 | pub fn new() -> ConstU32<{ u32() }> {
  |                            ^^^ not a function

error[E0308]: mismatched types
 --> /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:3:111
  |
3 | const fn identity<const T: identity::<{ identity::<{ identity::<{ identity::<{ /**...*/ }> }>() }>() }>>() -> u32 {  }
  |          -------- implicitly returns `()` as its body has no tail or `return` expression                      ^^^ expected `u32`, found `()`

error[E0308]: mismatched types
 --> /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:8:17
  |
8 | pub fn new() -> ConstU32<{ u32() }> {
  |        ---      ^^^^^^^^^^^^^^^^^^^ expected `ConstU32<{ u32() }>`, found `()`
  |        |
  |        implicitly returns `()` as its body has no tail or `return` expression
  |
  = note: expected struct `ConstU32<{ u32() }>`
          found unit type `()`

error: internal compiler error: compiler/rustc_hir_analysis/src/collect/generics_of.rs:226:14: unhandled node ConstArg(ConstArg { hir_id: HirId(DefId(0:3 ~ mvce[5a8b]::identity).19), kind: Path(Resolved(None, Path { span: /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:3:67: 3:91 (#0), res: Def(Fn, DefId(0:3 ~ mvce[5a8b]::identity)), segments: [PathSegment { ident: identity#0, hir_id: HirId(DefId(0:3 ~ mvce[5a8b]::identity).18), res: Def(Fn, DefId(0:3 ~ mvce[5a8b]::identity)), args: Some(GenericArgs { args: [Const(ConstArg { hir_id: HirId(DefId(0:3 ~ mvce[5a8b]::identity).17), kind: Anon(AnonConst { hir_id: HirId(DefId(0:3 ~ mvce[5a8b]::identity).14), def_id: DefId(0:8 ~ mvce[5a8b]::identity::{constant#0}::{constant#0}::{constant#0}::{constant#0}), body: BodyId { hir_id: HirId(DefId(0:3 ~ mvce[5a8b]::identity).15) }, span: /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:3:78: 3:90 (#0) }) })], constraints: [], parenthesized: No, span_ext: /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:3:77: 3:91 (#0) }), infer_args: false }] })) })
 --> /tmp/icemaker_global_tempdir.pxFd3gBGjYZY/rustc_testrunner_tmpdir_reporting.RwlW8FIEkoHd/mvce.rs:3:67
  |
3 | const fn identity<const T: identity::<{ identity::<{ identity::<{ identity::<{ /**...*/ }> }>() }>() }>>() -> u32 {  }
  |                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^


thread 'rustc' panicked at compiler/rustc_hir_analysis/src/collect/generics_of.rs:226:14:
Box<dyn Any>
stack backtrace:
   0:     0x73e490f30613 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h777b4d5b7dbb3ab3
   1:     0x73e4916027ff - core::fmt::write::hf3b23f29da02ec3a
   2:     0x73e490f26143 - std::io::Write::write_fmt::h2f0022cea6beafc7
   3:     0x73e490f30472 - std::sys::backtrace::BacktraceLock::print::h2b5e4c19e9e70c81
   4:     0x73e490f33f6a - std::panicking::default_hook::{{closure}}::hb4ba057717dbced5
   5:     0x73e490f33aef - std::panicking::default_hook::hf6ce2125dbdbfae1
   6:     0x73e48fffed03 - std[3c46b9eb67f00f78]::panicking::update_hook::<alloc[6a08b52f7c63c4c5]::boxed::Box<rustc_driver_impl[705e5eaf62d438bb]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x73e490f347bb - std::panicking::rust_panic_with_hook::h974459b183641fc7
   8:     0x73e4900389c1 - std[3c46b9eb67f00f78]::panicking::begin_panic::<rustc_errors[c81a47bb03d10c49]::ExplicitBug>::{closure#0}
   9:     0x73e49002cd86 - std[3c46b9eb67f00f78]::sys::backtrace::__rust_end_short_backtrace::<std[3c46b9eb67f00f78]::panicking::begin_panic<rustc_errors[c81a47bb03d10c49]::ExplicitBug>::{closure#0}, !>
  10:     0x73e49002cb77 - std[3c46b9eb67f00f78]::panicking::begin_panic::<rustc_errors[c81a47bb03d10c49]::ExplicitBug>
  11:     0x73e4900424a1 - <rustc_errors[c81a47bb03d10c49]::diagnostic::BugAbort as rustc_errors[c81a47bb03d10c49]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x73e490583ffc - <rustc_errors[c81a47bb03d10c49]::DiagCtxtHandle>::span_bug::<rustc_span[ea7dcc2b1ee22db4]::span_encoding::Span, alloc[6a08b52f7c63c4c5]::string::String>
  13:     0x73e4906191a7 - rustc_middle[e9f59b4e4013ff92]::util::bug::opt_span_bug_fmt::<rustc_span[ea7dcc2b1ee22db4]::span_encoding::Span>::{closure#0}
  14:     0x73e4905f8c8a - rustc_middle[e9f59b4e4013ff92]::ty::context::tls::with_opt::<rustc_middle[e9f59b4e4013ff92]::util::bug::opt_span_bug_fmt<rustc_span[ea7dcc2b1ee22db4]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:     0x73e4905f8afb - rustc_middle[e9f59b4e4013ff92]::ty::context::tls::with_context_opt::<rustc_middle[e9f59b4e4013ff92]::ty::context::tls::with_opt<rustc_middle[e9f59b4e4013ff92]::util::bug::opt_span_bug_fmt<rustc_span[ea7dcc2b1ee22db4]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:     0x73e48e655e37 - rustc_middle[e9f59b4e4013ff92]::util::bug::span_bug_fmt::<rustc_span[ea7dcc2b1ee22db4]::span_encoding::Span>
  17:     0x73e48ec8e3c0 - rustc_hir_analysis[ab9651012c5db622]::collect::generics_of::generics_of
  18:     0x73e4916477e9 - rustc_query_impl[d85220fa7fd32bf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d85220fa7fd32bf]::query_impl::generics_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 8usize]>>
  19:     0x73e491647ee5 - rustc_query_system[468cded001f439c3]::query::plumbing::try_execute_query::<rustc_query_impl[d85220fa7fd32bf]::DynamicConfig<rustc_query_system[468cded001f439c3]::query::caches::DefIdCache<rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d85220fa7fd32bf]::plumbing::QueryCtxt, false>
  20:     0x73e491647c1d - rustc_query_impl[d85220fa7fd32bf]::query_impl::generics_of::get_query_non_incr::__rust_end_short_backtrace
  21:     0x73e48ec8f3e6 - rustc_hir_analysis[ab9651012c5db622]::collect::generics_of::generics_of
  22:     0x73e4916477e9 - rustc_query_impl[d85220fa7fd32bf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d85220fa7fd32bf]::query_impl::generics_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 8usize]>>
  23:     0x73e491647ee5 - rustc_query_system[468cded001f439c3]::query::plumbing::try_execute_query::<rustc_query_impl[d85220fa7fd32bf]::DynamicConfig<rustc_query_system[468cded001f439c3]::query::caches::DefIdCache<rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d85220fa7fd32bf]::plumbing::QueryCtxt, false>
  24:     0x73e491647c1d - rustc_query_impl[d85220fa7fd32bf]::query_impl::generics_of::get_query_non_incr::__rust_end_short_backtrace
  25:     0x73e491fcfb96 - <rustc_middle[e9f59b4e4013ff92]::ty::list::RawList<(), rustc_middle[e9f59b4e4013ff92]::ty::generic_args::GenericArg>>::for_item::<<rustc_middle[e9f59b4e4013ff92]::ty::list::RawList<(), rustc_middle[e9f59b4e4013ff92]::ty::generic_args::GenericArg>>::identity_for_item<rustc_span[ea7dcc2b1ee22db4]::def_id::DefId>::{closure#0}>
  26:     0x73e491f168a0 - <dyn rustc_hir_analysis[ab9651012c5db622]::hir_ty_lowering::HirTyLowerer>::lower_const_arg
  27:     0x73e48ecb9f2d - <<dyn rustc_hir_analysis[ab9651012c5db622]::hir_ty_lowering::HirTyLowerer>::lower_generic_args_of_path::{closure#0}::GenericArgsCtxt as rustc_hir_analysis[ab9651012c5db622]::hir_ty_lowering::GenericArgsLowerer>::provided_kind
  28:     0x73e4901d5d93 - <dyn rustc_hir_analysis[ab9651012c5db622]::hir_ty_lowering::HirTyLowerer>::lower_generic_args_of_path_segment
  29:     0x73e491f17258 - <dyn rustc_hir_analysis[ab9651012c5db622]::hir_ty_lowering::HirTyLowerer>::lower_const_arg
  30:     0x73e492d41054 - <<rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::instantiate_value_path::CtorGenericArgsCtxt as rustc_hir_analysis[ab9651012c5db622]::hir_ty_lowering::GenericArgsLowerer>::provided_kind.warm
  31:     0x73e4923e540c - <rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::instantiate_value_path
  32:     0x73e4923db5e7 - <rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::check_expr_path
  33:     0x73e4925b7726 - <rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  34:     0x73e491907cb9 - <rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::check_expr_call
  35:     0x73e4925b8760 - <rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  36:     0x73e4918bbc8c - <rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::check_expr_block
  37:     0x73e4925b8cb6 - <rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  38:     0x73e4927ec852 - rustc_hir_typeck[3d8fe027d12f60fb]::typeck_with_inspect::{closure#0}
  39:     0x73e4927eadb0 - rustc_query_impl[d85220fa7fd32bf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d85220fa7fd32bf]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 8usize]>>
  40:     0x73e4917a3eee - rustc_query_system[468cded001f439c3]::query::plumbing::try_execute_query::<rustc_query_impl[d85220fa7fd32bf]::DynamicConfig<rustc_data_structures[ff3a6d2cb9f2c0ad]::vec_cache::VecCache<rustc_span[ea7dcc2b1ee22db4]::def_id::LocalDefId, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[468cded001f439c3]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[d85220fa7fd32bf]::plumbing::QueryCtxt, false>
  41:     0x73e4917a3889 - rustc_query_impl[d85220fa7fd32bf]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  42:     0x73e4920f60f7 - rustc_mir_build[902195af07c6ddbc]::thir::cx::thir_body
  43:     0x73e4920f4e1c - rustc_query_impl[d85220fa7fd32bf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d85220fa7fd32bf]::query_impl::thir_body::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 16usize]>>
  44:     0x73e491fc2cab - rustc_query_system[468cded001f439c3]::query::plumbing::try_execute_query::<rustc_query_impl[d85220fa7fd32bf]::DynamicConfig<rustc_data_structures[ff3a6d2cb9f2c0ad]::vec_cache::VecCache<rustc_span[ea7dcc2b1ee22db4]::def_id::LocalDefId, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[468cded001f439c3]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[d85220fa7fd32bf]::plumbing::QueryCtxt, false>
  45:     0x73e491fc290c - rustc_query_impl[d85220fa7fd32bf]::query_impl::thir_body::get_query_non_incr::__rust_end_short_backtrace
  46:     0x73e49197e187 - rustc_query_impl[d85220fa7fd32bf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d85220fa7fd32bf]::query_impl::thir_abstract_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 16usize]>>
  47:     0x73e49197e0cd - <rustc_query_impl[d85220fa7fd32bf]::query_impl::thir_abstract_const::dynamic_query::{closure#2} as core[3787519d2ef8946e]::ops::function::FnOnce<(rustc_middle[e9f59b4e4013ff92]::ty::context::TyCtxt, rustc_span[ea7dcc2b1ee22db4]::def_id::DefId)>>::call_once
  48:     0x73e4917bbb7b - rustc_query_system[468cded001f439c3]::query::plumbing::try_execute_query::<rustc_query_impl[d85220fa7fd32bf]::DynamicConfig<rustc_query_system[468cded001f439c3]::query::caches::DefIdCache<rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[d85220fa7fd32bf]::plumbing::QueryCtxt, false>
  49:     0x73e4917bb7b2 - rustc_query_impl[d85220fa7fd32bf]::query_impl::thir_abstract_const::get_query_non_incr::__rust_end_short_backtrace
  50:     0x73e492d64691 - <<rustc_middle[e9f59b4e4013ff92]::ty::context::TyCtxt>::expand_abstract_consts::Expander as rustc_type_ir[f7ec40aa9cc7f67f]::fold::TypeFolder<rustc_middle[e9f59b4e4013ff92]::ty::context::TyCtxt>>::fold_const.warm
  51:     0x73e491b02331 - rustc_trait_selection[2b6744d267096662]::traits::const_evaluatable::is_const_evaluatable
  52:     0x73e492122579 - <rustc_trait_selection[2b6744d267096662]::traits::fulfill::FulfillProcessor as rustc_data_structures[ff3a6d2cb9f2c0ad]::obligation_forest::ObligationProcessor>::process_obligation
  53:     0x73e4916058c2 - <rustc_data_structures[ff3a6d2cb9f2c0ad]::obligation_forest::ObligationForest<rustc_trait_selection[2b6744d267096662]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[2b6744d267096662]::traits::fulfill::FulfillProcessor>
  54:     0x73e49190ab21 - <rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::check_expr_call
  55:     0x73e4925b8760 - <rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  56:     0x73e4918bbc8c - <rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::check_expr_block
  57:     0x73e4925b8cb6 - <rustc_hir_typeck[3d8fe027d12f60fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  58:     0x73e4927ec852 - rustc_hir_typeck[3d8fe027d12f60fb]::typeck_with_inspect::{closure#0}
  59:     0x73e4927eadb0 - rustc_query_impl[d85220fa7fd32bf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d85220fa7fd32bf]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 8usize]>>
  60:     0x73e4917a3eee - rustc_query_system[468cded001f439c3]::query::plumbing::try_execute_query::<rustc_query_impl[d85220fa7fd32bf]::DynamicConfig<rustc_data_structures[ff3a6d2cb9f2c0ad]::vec_cache::VecCache<rustc_span[ea7dcc2b1ee22db4]::def_id::LocalDefId, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[468cded001f439c3]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[d85220fa7fd32bf]::plumbing::QueryCtxt, false>
  61:     0x73e4917a3889 - rustc_query_impl[d85220fa7fd32bf]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  62:     0x73e4917a4d39 - rustc_query_impl[d85220fa7fd32bf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d85220fa7fd32bf]::query_impl::used_trait_imports::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 8usize]>>
  63:     0x73e4917a3eee - rustc_query_system[468cded001f439c3]::query::plumbing::try_execute_query::<rustc_query_impl[d85220fa7fd32bf]::DynamicConfig<rustc_data_structures[ff3a6d2cb9f2c0ad]::vec_cache::VecCache<rustc_span[ea7dcc2b1ee22db4]::def_id::LocalDefId, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[468cded001f439c3]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[d85220fa7fd32bf]::plumbing::QueryCtxt, false>
  64:     0x73e4917a37c9 - rustc_query_impl[d85220fa7fd32bf]::query_impl::used_trait_imports::get_query_non_incr::__rust_end_short_backtrace
  65:     0x73e4917a3341 - rustc_hir_analysis[ab9651012c5db622]::check_unused::check_unused_traits
  66:     0x73e4917a31f1 - rustc_query_impl[d85220fa7fd32bf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d85220fa7fd32bf]::query_impl::check_unused_traits::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 0usize]>>
  67:     0x73e4926a0930 - rustc_query_system[468cded001f439c3]::query::plumbing::try_execute_query::<rustc_query_impl[d85220fa7fd32bf]::DynamicConfig<rustc_query_system[468cded001f439c3]::query::caches::SingleCache<rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[d85220fa7fd32bf]::plumbing::QueryCtxt, false>
  68:     0x73e4926a068e - rustc_query_impl[d85220fa7fd32bf]::query_impl::check_unused_traits::get_query_non_incr::__rust_end_short_backtrace
  69:     0x73e491de2b67 - rustc_hir_analysis[ab9651012c5db622]::check_crate
  70:     0x73e4920d7063 - rustc_interface[14a849aff36076f8]::passes::analysis
  71:     0x73e4920d6c6b - rustc_query_impl[d85220fa7fd32bf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d85220fa7fd32bf]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 0usize]>>
  72:     0x73e4926a0930 - rustc_query_system[468cded001f439c3]::query::plumbing::try_execute_query::<rustc_query_impl[d85220fa7fd32bf]::DynamicConfig<rustc_query_system[468cded001f439c3]::query::caches::SingleCache<rustc_middle[e9f59b4e4013ff92]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[d85220fa7fd32bf]::plumbing::QueryCtxt, false>
  73:     0x73e4926a04fc - rustc_query_impl[d85220fa7fd32bf]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  74:     0x73e4928a4ed6 - rustc_interface[14a849aff36076f8]::passes::create_and_enter_global_ctxt::<core[3787519d2ef8946e]::option::Option<rustc_interface[14a849aff36076f8]::queries::Linker>, rustc_driver_impl[705e5eaf62d438bb]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  75:     0x73e492877d83 - rustc_interface[14a849aff36076f8]::interface::run_compiler::<(), rustc_driver_impl[705e5eaf62d438bb]::run_compiler::{closure#0}>::{closure#1}
  76:     0x73e49281bb38 - std[3c46b9eb67f00f78]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[14a849aff36076f8]::util::run_in_thread_with_globals<rustc_interface[14a849aff36076f8]::util::run_in_thread_pool_with_globals<rustc_interface[14a849aff36076f8]::interface::run_compiler<(), rustc_driver_impl[705e5eaf62d438bb]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  77:     0x73e49281b816 - <<std[3c46b9eb67f00f78]::thread::Builder>::spawn_unchecked_<rustc_interface[14a849aff36076f8]::util::run_in_thread_with_globals<rustc_interface[14a849aff36076f8]::util::run_in_thread_pool_with_globals<rustc_interface[14a849aff36076f8]::interface::run_compiler<(), rustc_driver_impl[705e5eaf62d438bb]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[3787519d2ef8946e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  78:     0x73e492819e3d - std::sys::pal::unix::thread::Thread::new::thread_start::h1b394520373fba89
  79:     0x73e48c29b7eb - <unknown>
  80:     0x73e48c31f18c - <unknown>
  81:                0x0 - <unknown>

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: rustc 1.90.0-nightly (6268d0aa3 2025-07-03) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z crate-attr=feature(generic_const_exprs) -Z crate-attr=feature(min_generic_const_args) -Z dump-mir-dir=dir

query stack during panic:
#0 [generics_of] computing generics of `identity::{constant#0}::{constant#0}::{constant#0}`
#1 [generics_of] computing generics of `identity::{constant#0}::{constant#0}::{constant#0}::{constant#0}`
#2 [typeck] type-checking `identity::{constant#0}::{constant#0}`
#3 [thir_body] building THIR for `identity::{constant#0}::{constant#0}`
#4 [thir_abstract_const] building an abstract representation for `identity::{constant#0}::{constant#0}`
#5 [typeck] type-checking `identity::{constant#0}`
#6 [used_trait_imports] finding used_trait_imports `identity::{constant#0}`
#7 [check_unused_traits] checking unused trait imports in crate
#8 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 10 previous errors; 2 warnings emitted

Some errors have detailed explanations: E0308, E0423, E0573, E0585, E0601.
For more information about an error, try `rustc --explain E0308`.

@rustbot label +F-generic_const_exprs +F-min_generic_const_args

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-generic_const_exprs`#![feature(generic_const_exprs)]`F-min_generic_const_args`#![feature(min_generic_const_args)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions