Repository navigation
Closed as duplicate
Closed as duplicate
Copy link
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.F-gca_const_items`#![feature(gca_const_items)]` (previously: `generic_const_args`)`#![feature(gca_const_items)]` (previously: `generic_const_args`)F-gca_min_const_items`#![feature(gca_min_const_items)]` (previously: `min_generic_const_args`)`#![feature(gca_min_const_items)]` (previously: `min_generic_const_args`)F-generic_const_items`#![feature(generic_const_items)]``#![feature(generic_const_items)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)The Rustc Trait System Refactor Initiative (-Znext-solver)
Description
Code
#![expect(incomplete_features, reason = "generic_const_*")]
#![feature(
generic_const_args,
generic_const_items,
min_generic_const_args
)]
const TREE_SIZE_WITHOUT_LEAVES<const N: usize>: usize = {
N - 1
};
pub struct BalancedMerkleTree<const N: usize> {
tree: [(); TREE_SIZE_WITHOUT_LEAVES::<N>],
}Tested with RUSTFLAGS="-Znext-solver=globally" RUSTDOCFLAGS="-Znext-solver=globally" cargo doc
Meta
rustc --version --verbose:
rustc 1.99.0-nightly (af3d95584 2026-07-09)
binary: rustc
commit-hash: af3d95584dbddcae597890340995509a7fb47a50
commit-date: 2026-07-09
host: x86_64-unknown-linux-gnu
release: 1.99.0-nightly
LLVM version: 22.1.8
Error output
Backtrace
thread 'rustc' (949502) panicked at /rustc-dev/af3d95584dbddcae597890340995509a7fb47a50/compiler/rustc_type_ir/src/binder.rs:1317:13:
cannot find `!BoundConst { var: 0, .. }` in param-env: ParamEnv {
caller_bounds: [],
}
stack backtrace:
0: 0x7f4a79b0d266 - <<std[40ec4738f960212f]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[f94227772a84a350]::fmt::Display>::fmt
1: 0x7f4a7a20ee08 - core[f94227772a84a350]::fmt::write
2: 0x7f4a79b2264c - <std[40ec4738f960212f]::sys::stdio::unix::Stderr as std[40ec4738f960212f]::io::Write>::write_fmt
3: 0x7f4a79ae156a - std[40ec4738f960212f]::panicking::default_hook::{closure#0}
4: 0x7f4a79aff923 - std[40ec4738f960212f]::panicking::default_hook
5: 0x7f4a78ae4828 - std[40ec4738f960212f]::panicking::update_hook::<alloc[15af67eb22419dcd]::boxed::Box<rustc_driver_impl[4720cc46e2ef7529]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7f4a79affdc2 - std[40ec4738f960212f]::panicking::panic_with_hook
7: 0x7f4a79ae1622 - std[40ec4738f960212f]::panicking::panic_handler::{closure#0}
8: 0x7f4a79ad5b09 - std[40ec4738f960212f]::sys::backtrace::__rust_end_short_backtrace::<std[40ec4738f960212f]::panicking::panic_handler::{closure#0}, !>
9: 0x7f4a79ae2f8d - __rustc[4a4b9b94957988a7]::rust_begin_unwind
10: 0x7f4a76c7b3dc - core[f94227772a84a350]::panicking::panic_fmt
11: 0x7f4a7b44eed6 - <rustc_next_trait_solver[5e27b30a7c27b9e6]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[27d012fca9780532]::solve::delegate::SolverDelegate> as rustc_type_ir[d247da7ee518b5fa]::search_graph::Delegate>::compute_goal::{closure#0}
12: 0x7f4a7745c803 - <rustc_type_ir[d247da7ee518b5fa]::search_graph::SearchGraph<rustc_next_trait_solver[5e27b30a7c27b9e6]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[27d012fca9780532]::solve::delegate::SolverDelegate>, rustc_middle[422739edb7f5a344]::ty::context::TyCtxt>>::evaluate_goal::{closure#0}
13: 0x7f4a7adc1b63 - <rustc_next_trait_solver[5e27b30a7c27b9e6]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[27d012fca9780532]::solve::delegate::SolverDelegate, rustc_middle[422739edb7f5a344]::ty::context::TyCtxt>>::evaluate_goal_cold
14: 0x7f4a7adad828 - <rustc_next_trait_solver[5e27b30a7c27b9e6]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[27d012fca9780532]::solve::delegate::SolverDelegate, rustc_middle[422739edb7f5a344]::ty::context::TyCtxt>>::evaluate_added_goals_step
15: 0x7f4a7af54603 - <rustc_next_trait_solver[5e27b30a7c27b9e6]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[27d012fca9780532]::solve::delegate::SolverDelegate, rustc_middle[422739edb7f5a344]::ty::context::TyCtxt>>::evaluate_added_goals_and_make_canonical_response::{closure#0}
16: 0x7f4a7af5b954 - <rustc_next_trait_solver[5e27b30a7c27b9e6]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[27d012fca9780532]::solve::delegate::SolverDelegate, rustc_middle[422739edb7f5a344]::ty::context::TyCtxt>>::evaluate_const_and_instantiate_projection_term
17: 0x7f4a7b44f58b - <rustc_next_trait_solver[5e27b30a7c27b9e6]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[27d012fca9780532]::solve::delegate::SolverDelegate> as rustc_type_ir[d247da7ee518b5fa]::search_graph::Delegate>::compute_goal::{closure#0}
18: 0x7f4a7745c803 - <rustc_type_ir[d247da7ee518b5fa]::search_graph::SearchGraph<rustc_next_trait_solver[5e27b30a7c27b9e6]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[27d012fca9780532]::solve::delegate::SolverDelegate>, rustc_middle[422739edb7f5a344]::ty::context::TyCtxt>>::evaluate_goal::{closure#0}
19: 0x7f4a7adc305b - <rustc_next_trait_solver[5e27b30a7c27b9e6]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[27d012fca9780532]::solve::delegate::SolverDelegate, rustc_middle[422739edb7f5a344]::ty::context::TyCtxt>>::evaluate_goal_cold
20: 0x7f4a7b421209 - <rustc_trait_selection[27d012fca9780532]::solve::delegate::SolverDelegate as rustc_next_trait_solver[5e27b30a7c27b9e6]::solve::eval_ctxt::SolverDelegateEvalExt>::evaluate_root_goal
21: 0x7f4a7b41eea9 - <rustc_next_trait_solver[5e27b30a7c27b9e6]::normalize::NormalizationFolder<rustc_infer[746a1668c57c4cb2]::infer::InferCtxt, rustc_middle[422739edb7f5a344]::ty::context::TyCtxt, rustc_trait_selection[27d012fca9780532]::solve::normalize::normalize_with_universes<rustc_middle[422739edb7f5a344]::ty::generic_args::GenericArg>::{closure#0}>>::normalize_alias_term
22: 0x7f4a7b41e5e7 - <rustc_next_trait_solver[5e27b30a7c27b9e6]::normalize::NormalizationFolder<rustc_infer[746a1668c57c4cb2]::infer::InferCtxt, rustc_middle[422739edb7f5a344]::ty::context::TyCtxt, rustc_trait_selection[27d012fca9780532]::solve::normalize::normalize_with_universes<rustc_middle[422739edb7f5a344]::ty::generic_args::GenericArg>::{closure#0}> as rustc_type_ir[d247da7ee518b5fa]::fold::FallibleTypeFolder<rustc_middle[422739edb7f5a344]::ty::context::TyCtxt>>::try_fold_const::{closure#0}
23: 0x7f4a7aa90b2e - <rustc_traits[3d65881876e845f0]::normalize_erasing_regions::provide::{closure#0} as core[f94227772a84a350]::ops::function::FnOnce<(rustc_middle[422739edb7f5a344]::ty::context::TyCtxt, rustc_middle[422739edb7f5a344]::ty::PseudoCanonicalInput<rustc_middle[422739edb7f5a344]::ty::generic_args::GenericArg>)>>::call_once
24: 0x7f4a7ad7c14e - rustc_query_impl[1cd46de70f375db8]::execution::try_execute_query::<rustc_middle[422739edb7f5a344]::query::caches::DefaultCache<rustc_middle[422739edb7f5a344]::ty::PseudoCanonicalInput<rustc_middle[422739edb7f5a344]::ty::generic_args::GenericArg>, rustc_middle[422739edb7f5a344]::query::erase::ErasedData<[u8; 8usize]>>, false>
25: 0x7f4a7ad7bdc1 - rustc_query_impl[1cd46de70f375db8]::query_impl::try_normalize_generic_arg_after_erasing_regions::execute_query_non_incr::__rust_end_short_backtrace
26: 0x7f4a781b101e - <rustc_middle[422739edb7f5a344]::ty::normalize_erasing_regions::TryNormalizeAfterErasingRegionsFolder as rustc_type_ir[d247da7ee518b5fa]::fold::FallibleTypeFolder<rustc_middle[422739edb7f5a344]::ty::context::TyCtxt>>::try_fold_const
27: 0x555bdfc8beb4 - rustdoc[5842327c84a5b3ea]::clean::clean_middle_ty
28: 0x555bdfc8ee3d - rustdoc[5842327c84a5b3ea]::clean::clean_predicate
29: 0x555bdfdd3935 - <core[f94227772a84a350]::iter::adapters::chain::Chain<core[f94227772a84a350]::iter::adapters::flatten::FlatMap<core[f94227772a84a350]::iter::adapters::map::Map<core[f94227772a84a350]::iter::adapters::filter::Filter<core[f94227772a84a350]::iter::adapters::copied::Copied<core[f94227772a84a350]::slice::iter::Iter<rustc_middle[422739edb7f5a344]::ty::predicate::Clause>>, rustdoc[5842327c84a5b3ea]::clean::auto_trait::clean_param_env::{closure#2}>, rustdoc[5842327c84a5b3ea]::clean::auto_trait::clean_param_env::{closure#3}>, core[f94227772a84a350]::option::Option<rustdoc[5842327c84a5b3ea]::clean::types::WherePredicate>, rustdoc[5842327c84a5b3ea]::clean::auto_trait::clean_param_env::{closure#4}>, thin_vec[7ecaf0422a4a7260]::IntoIter<rustdoc[5842327c84a5b3ea]::clean::types::WherePredicate>> as core[f94227772a84a350]::iter::traits::iterator::Iterator>::next
30: 0x555bdfcc8b82 - rustdoc[5842327c84a5b3ea]::clean::auto_trait::clean_param_env
31: 0x555bdfa33f59 - <rustc_trait_selection[27d012fca9780532]::traits::auto_trait::AutoTraitFinder>::find_auto_trait_generics::<rustdoc[5842327c84a5b3ea]::clean::types::Generics, rustdoc[5842327c84a5b3ea]::clean::auto_trait::synthesize_auto_trait_impl::{closure#0}>
32: 0x555bdfcca026 - rustdoc[5842327c84a5b3ea]::clean::auto_trait::synthesize_auto_trait_impl
33: 0x555bdfcd10c3 - rustdoc[5842327c84a5b3ea]::clean::utils::synthesize_auto_trait_and_blanket_impls
34: 0x555bdfd186f2 - <rustdoc[5842327c84a5b3ea]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[5842327c84a5b3ea]::visit::DocVisitor>::visit_item
35: 0x555bdfd18509 - <rustdoc[5842327c84a5b3ea]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[5842327c84a5b3ea]::visit::DocVisitor>::visit_item
36: 0x555bdfcded54 - rustdoc[5842327c84a5b3ea]::passes::collect_trait_impls::collect_trait_impls
37: 0x555bdfc822ed - rustdoc[5842327c84a5b3ea]::core::run_global_ctxt
38: 0x555bdfbb8486 - rustdoc[5842327c84a5b3ea]::main_args::{closure#2}::{closure#0}
39: 0x555bdfbafe8a - rustc_interface[96c4102e2fe97684]::interface::run_compiler::<(), rustdoc[5842327c84a5b3ea]::main_args::{closure#2}>::{closure#1}
40: 0x555bdfafec58 - std[40ec4738f960212f]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[96c4102e2fe97684]::util::run_in_thread_with_globals<rustc_interface[96c4102e2fe97684]::util::run_in_thread_pool_with_globals<rustc_interface[96c4102e2fe97684]::interface::run_compiler<(), rustdoc[5842327c84a5b3ea]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
41: 0x555bdfbef55d - <std[40ec4738f960212f]::thread::lifecycle::spawn_unchecked<rustc_interface[96c4102e2fe97684]::util::run_in_thread_with_globals<rustc_interface[96c4102e2fe97684]::util::run_in_thread_pool_with_globals<rustc_interface[96c4102e2fe97684]::interface::run_compiler<(), rustdoc[5842327c84a5b3ea]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[f94227772a84a350]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
42: 0x7f4a7b3e23ba - <std[40ec4738f960212f]::sys::thread::unix::Thread>::new::thread_start
43: 0x7f4a74ca40da - start_thread
at ./nptl/pthread_create.c:454:8
44: 0x7f4a74d377ac - __GI___clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
45: 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-rustdoc&template=ice.md
note: please make sure that you have updated to the latest nightly
note: please attach the file at `/web/github/abundance/rustc-ice-2026-07-10T10_38_33-949501.txt` to your bug report
note: rustc 1.99.0-nightly (af3d95584 2026-07-09) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type lib -Z next-solver=globally
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [try_normalize_generic_arg_after_erasing_regions] normalizing `TREE_SIZE_WITHOUT_LEAVES::<N>`
end of query stack
error: could not document `ab-merkle-tree`
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.F-gca_const_items`#![feature(gca_const_items)]` (previously: `generic_const_args`)`#![feature(gca_const_items)]` (previously: `generic_const_args`)F-gca_min_const_items`#![feature(gca_min_const_items)]` (previously: `min_generic_const_args`)`#![feature(gca_min_const_items)]` (previously: `min_generic_const_args`)F-generic_const_items`#![feature(generic_const_items)]``#![feature(generic_const_items)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)The Rustc Trait System Refactor Initiative (-Znext-solver)
Activity
chenyukang commentedon Jul 12, 2026
duplicated with #159065
nazar-pc commentedon Jul 12, 2026
The error looks the same, but reproduction and backtrace are different, so I wasn't so sure
LaneAsade commentedon Jul 13, 2026
@rustbot claim
nazar-pc commentedon Jul 16, 2026
Looks like this was fixed in #159194 alongside #159065 🎉
cannot find '!BoundConst { var: 0, .. }' in param-env: ParamEnv#159065