Skip to content

feature(associated_const_equality) allows const arguments to generic const parameters #108271

Closed
@BoxyUwU

Description

@BoxyUwU

Code

pub trait TraitWAssocConst<T> {
    const A: T;
}

fn main<T, B: TraitWAssocConst<T, A = { 1 }>>() {}
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

pub trait TraitWAssocConst {
    const A: dyn TraitWAssocConst<A=0>;
}

fn bar<A: TraitWAssocConst<A=0>>() {}

Meta

Both code snippets ICE on the following version as we added an assert that we do not support arguments to generic const parameters
rustc --version --verbose:

rustc 1.69.0-nightly (7aa413d59 2023-02-19)
binary: rustc
commit-hash: 7aa413d59206fd511137728df3d9e0fd377429bd
commit-date: 2023-02-19
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7

The first code snippet ICEs before we added that assertion
rustc --version --verbose:

rustc 1.69.0-nightly (8996ea93b 2023-02-09)
binary: rustc
commit-hash: 8996ea93b6e554148c4286e62b613f12a3ee505c
commit-date: 2023-02-09
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

for the first code snippet on stable:

error[E0658]: associated const equality is incomplete
 --> src/lib.rs:5:35
  |
5 | fn main<T, B: TraitWAssocConst<T, A = { 1 }>>() {}
  |                                   ^^^^^^^^^
  |
  = note: see issue #92827 <https://github.com/rust-lang/rust/issues/92827> for more information
Backtrace on new rustc

thread 'rustc' panicked at 'const parameter types cannot be generic', compiler/rustc_middle/src/ty/consts.rs:79:14
stack backtrace:
   0:     0x7f61f4a6aa7a - std::backtrace_rs::backtrace::libunwind::trace::h9489b6bb69d0b539
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f61f4a6aa7a - std::backtrace_rs::backtrace::trace_unsynchronized::h074cc8d03fa8d3dc
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f61f4a6aa7a - std::sys_common::backtrace::_print_fmt::h855b454124c5eb62
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f61f4a6aa7a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb1cc20dbe9783028
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f61f4aca9fe - core::fmt::write::h2ce679bf0de92319
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/core/src/fmt/mod.rs:1232:17
   5:     0x7f61f4a5af25 - std::io::Write::write_fmt::hf0d271cfceb9d3c2
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/io/mod.rs:1684:15
   6:     0x7f61f4a6a845 - std::sys_common::backtrace::_print::ha1c1c6cae6faf548
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f61f4a6a845 - std::sys_common::backtrace::print::h4c052fa11a0cef4b
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f61f4a6d5bf - std::panicking::default_hook::{{closure}}::h844c6ede57d48540
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/panicking.rs:267:22
   9:     0x7f61f4a6d2fb - std::panicking::default_hook::h854c8cb7dd25b7a5
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/panicking.rs:286:9
  10:     0x7f61f7d392b5 - <rustc_driver_impl[6e32b0e3e4ecc577]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[7c7d3fa1b0e0eb0]::ops::function::FnOnce<(&core[7c7d3fa1b0e0eb0]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f61f4a6ddfd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h99a819f48eb65709
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/alloc/src/boxed.rs:2002:9
  12:     0x7f61f4a6ddfd - std::panicking::rust_panic_with_hook::hfdf377d5e3bd50c0
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/panicking.rs:692:13
  13:     0x7f61f4a6db79 - std::panicking::begin_panic_handler::{{closure}}::h202f06f8586acb9b
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/panicking.rs:579:13
  14:     0x7f61f4a6aee6 - std::sys_common::backtrace::__rust_end_short_backtrace::he788777797a37096
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/sys_common/backtrace.rs:137:18
  15:     0x7f61f4a6d882 - rust_begin_unwind
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/panicking.rs:575:5
  16:     0x7f61f4ac73a3 - core::panicking::panic_fmt::h704f91c520cedbb5
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/core/src/panicking.rs:64:14
  17:     0x7f61f4ac7511 - core::panicking::panic_display::h266642d353982487
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/core/src/panicking.rs:147:5
  18:     0x7f61f4ac74bb - core::panicking::panic_str::h432fce4072f677fc
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/core/src/panicking.rs:131:5
  19:     0x7f61f4ac7126 - core::option::expect_failed::hce458ff48e1f956a
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/core/src/option.rs:1926:5
  20:     0x7f61f6e19bba - <rustc_middle[f89b3bfcac62aa00]::ty::consts::Const>::from_opt_const_arg_anon_const
  21:     0x7f61f6fb1aab - <core[7c7d3fa1b0e0eb0]::iter::adapters::map::Map<core[7c7d3fa1b0e0eb0]::slice::iter::Iter<rustc_hir[55544527a2f33a6f]::hir::TypeBinding>, <dyn rustc_hir_analysis[f4a7f86752221ece]::astconv::AstConv>::create_assoc_bindings_for_generic_args::{closure#0}> as core[7c7d3fa1b0e0eb0]::iter::traits::iterator::Iterator>::fold::<(), core[7c7d3fa1b0e0eb0]::iter::traits::iterator::Iterator::for_each::call<rustc_hir_analysis[f4a7f86752221ece]::astconv::ConvertedBinding, <alloc[f648dfb059bacbe8]::vec::Vec<rustc_hir_analysis[f4a7f86752221ece]::astconv::ConvertedBinding>>::extend_trusted<core[7c7d3fa1b0e0eb0]::iter::adapters::map::Map<core[7c7d3fa1b0e0eb0]::slice::iter::Iter<rustc_hir[55544527a2f33a6f]::hir::TypeBinding>, <dyn rustc_hir_analysis[f4a7f86752221ece]::astconv::AstConv>::create_assoc_bindings_for_generic_args::{closure#0}>>::{closure#0}>::{closure#0}>
  22:     0x7f61f6fad647 - <dyn rustc_hir_analysis[f4a7f86752221ece]::astconv::AstConv>::instantiate_poly_trait_ref_inner
  23:     0x7f61f6fac02c - <dyn rustc_hir_analysis[f4a7f86752221ece]::astconv::AstConv>::instantiate_poly_trait_ref
  24:     0x7f61f6101240 - rustc_hir_analysis[f4a7f86752221ece]::collect::predicates_of::gather_explicit_predicates_of
  25:     0x7f61f60ff709 - rustc_hir_analysis[f4a7f86752221ece]::collect::predicates_of::explicit_predicates_of
  26:     0x7f61f683d2e3 - <rustc_query_system[61b579b99652e722]::dep_graph::graph::DepGraph<rustc_middle[f89b3bfcac62aa00]::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl[ae5df09473318626]::plumbing::QueryCtxt, rustc_span[cd9543e8608582e7]::def_id::DefId, rustc_middle[f89b3bfcac62aa00]::ty::generics::GenericPredicates>
  27:     0x7f61f6837d4b - rustc_query_system[61b579b99652e722]::query::plumbing::get_query::<rustc_query_impl[ae5df09473318626]::queries::explicit_predicates_of, rustc_query_impl[ae5df09473318626]::plumbing::QueryCtxt, rustc_middle[f89b3bfcac62aa00]::dep_graph::dep_node::DepKind>
  28:     0x7f61f683274f - rustc_hir_analysis[f4a7f86752221ece]::collect::predicates_defined_on
  29:     0x7f61f683e5a8 - <rustc_query_system[61b579b99652e722]::dep_graph::graph::DepGraph<rustc_middle[f89b3bfcac62aa00]::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl[ae5df09473318626]::plumbing::QueryCtxt, rustc_span[cd9543e8608582e7]::def_id::DefId, rustc_middle[f89b3bfcac62aa00]::ty::generics::GenericPredicates>
  30:     0x7f61f67a61c3 - rustc_hir_analysis[f4a7f86752221ece]::collect::predicates_of::predicates_of
  31:     0x7f61f683d2a3 - <rustc_query_system[61b579b99652e722]::dep_graph::graph::DepGraph<rustc_middle[f89b3bfcac62aa00]::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl[ae5df09473318626]::plumbing::QueryCtxt, rustc_span[cd9543e8608582e7]::def_id::DefId, rustc_middle[f89b3bfcac62aa00]::ty::generics::GenericPredicates>
  32:     0x7f61f67a3088 - rustc_query_system[61b579b99652e722]::query::plumbing::get_query::<rustc_query_impl[ae5df09473318626]::queries::predicates_of, rustc_query_impl[ae5df09473318626]::plumbing::QueryCtxt, rustc_middle[f89b3bfcac62aa00]::dep_graph::dep_node::DepKind>
  33:     0x7f61f67a2603 - <rustc_query_impl[ae5df09473318626]::Queries as rustc_middle[f89b3bfcac62aa00]::ty::query::QueryEngine>::predicates_of
  34:     0x7f61f64031a0 - <rustc_hir_analysis[f4a7f86752221ece]::collect::CollectItemTypesVisitor as rustc_hir[55544527a2f33a6f]::intravisit::Visitor>::visit_item
  35:     0x7f61f6401f65 - <rustc_middle[f89b3bfcac62aa00]::hir::map::Map>::visit_item_likes_in_module::<rustc_hir_analysis[f4a7f86752221ece]::collect::CollectItemTypesVisitor>
  36:     0x7f61f6401e7c - rustc_hir_analysis[f4a7f86752221ece]::collect::collect_mod_item_types
  37:     0x7f61f664f413 - <rustc_query_system[61b579b99652e722]::dep_graph::graph::DepGraph<rustc_middle[f89b3bfcac62aa00]::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl[ae5df09473318626]::plumbing::QueryCtxt, rustc_span[cd9543e8608582e7]::def_id::LocalDefId, ()>
  38:     0x7f61f732b8ab - rustc_query_system[61b579b99652e722]::query::plumbing::try_execute_query::<rustc_query_impl[ae5df09473318626]::queries::collect_mod_item_types, rustc_query_impl[ae5df09473318626]::plumbing::QueryCtxt>
  39:     0x7f61f7731b7d - <rustc_query_impl[ae5df09473318626]::Queries as rustc_middle[f89b3bfcac62aa00]::ty::query::QueryEngine>::collect_mod_item_types
  40:     0x7f61f744226f - <rustc_middle[f89b3bfcac62aa00]::hir::map::Map>::for_each_module::<rustc_hir_analysis[f4a7f86752221ece]::check_crate::{closure#0}::{closure#0}::{closure#0}>
  41:     0x7f61f62279ac - rustc_hir_analysis[f4a7f86752221ece]::check_crate
  42:     0x7f61f621f062 - rustc_interface[c6f24677e94f9079]::passes::analysis
  43:     0x7f61f75537b1 - <rustc_query_system[61b579b99652e722]::dep_graph::graph::DepGraph<rustc_middle[f89b3bfcac62aa00]::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl[ae5df09473318626]::plumbing::QueryCtxt, (), core[7c7d3fa1b0e0eb0]::result::Result<(), rustc_errors[6988015e967c596d]::ErrorGuaranteed>>
  44:     0x7f61f7552e22 - rustc_query_system[61b579b99652e722]::query::plumbing::try_execute_query::<rustc_query_impl[ae5df09473318626]::queries::analysis, rustc_query_impl[ae5df09473318626]::plumbing::QueryCtxt>
  45:     0x7f61f772b4ba - <rustc_query_impl[ae5df09473318626]::Queries as rustc_middle[f89b3bfcac62aa00]::ty::query::QueryEngine>::analysis
  46:     0x7f61f6fc07d6 - <rustc_middle[f89b3bfcac62aa00]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[6e32b0e3e4ecc577]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[7c7d3fa1b0e0eb0]::result::Result<(), rustc_errors[6988015e967c596d]::ErrorGuaranteed>>
  47:     0x7f61f6fbf6c6 - <rustc_interface[c6f24677e94f9079]::interface::Compiler>::enter::<rustc_driver_impl[6e32b0e3e4ecc577]::run_compiler::{closure#1}::{closure#2}, core[7c7d3fa1b0e0eb0]::result::Result<core[7c7d3fa1b0e0eb0]::option::Option<rustc_interface[c6f24677e94f9079]::queries::Linker>, rustc_errors[6988015e967c596d]::ErrorGuaranteed>>
  48:     0x7f61f6fbd7a4 - rustc_span[cd9543e8608582e7]::with_source_map::<core[7c7d3fa1b0e0eb0]::result::Result<(), rustc_errors[6988015e967c596d]::ErrorGuaranteed>, rustc_interface[c6f24677e94f9079]::interface::run_compiler<core[7c7d3fa1b0e0eb0]::result::Result<(), rustc_errors[6988015e967c596d]::ErrorGuaranteed>, rustc_driver_impl[6e32b0e3e4ecc577]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  49:     0x7f61f6fbcd0d - std[52c1871eff67b331]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[c6f24677e94f9079]::util::run_in_thread_pool_with_globals<rustc_interface[c6f24677e94f9079]::interface::run_compiler<core[7c7d3fa1b0e0eb0]::result::Result<(), rustc_errors[6988015e967c596d]::ErrorGuaranteed>, rustc_driver_impl[6e32b0e3e4ecc577]::run_compiler::{closure#1}>::{closure#0}, core[7c7d3fa1b0e0eb0]::result::Result<(), rustc_errors[6988015e967c596d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7c7d3fa1b0e0eb0]::result::Result<(), rustc_errors[6988015e967c596d]::ErrorGuaranteed>>
  50:     0x7f61f6fbc75c - <<std[52c1871eff67b331]::thread::Builder>::spawn_unchecked_<rustc_interface[c6f24677e94f9079]::util::run_in_thread_pool_with_globals<rustc_interface[c6f24677e94f9079]::interface::run_compiler<core[7c7d3fa1b0e0eb0]::result::Result<(), rustc_errors[6988015e967c596d]::ErrorGuaranteed>, rustc_driver_impl[6e32b0e3e4ecc577]::run_compiler::{closure#1}>::{closure#0}, core[7c7d3fa1b0e0eb0]::result::Result<(), rustc_errors[6988015e967c596d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7c7d3fa1b0e0eb0]::result::Result<(), rustc_errors[6988015e967c596d]::ErrorGuaranteed>>::{closure#1} as core[7c7d3fa1b0e0eb0]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  51:     0x7f61f4a77c83 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd495064039f63337
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/alloc/src/boxed.rs:1988:9
  52:     0x7f61f4a77c83 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5810b8a5e2a1ff63
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/alloc/src/boxed.rs:1988:9
  53:     0x7f61f4a77c83 - std::sys::unix::thread::Thread::new::thread_start::hda99a0382c8f8399
                               at /rustc/7aa413d59206fd511137728df3d9e0fd377429bd/library/std/src/sys/unix/thread.rs:108:17
  54:     0x7f61f47adb43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  55:     0x7f61f483fa00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  56:                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: rustc 1.69.0-nightly (7aa413d59 2023-02-19) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -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 [explicit_predicates_of] computing explicit predicates of `main`
#1 [predicates_defined_on] computing predicates of `main`
#2 [predicates_of] computing predicates of `main`
#3 [collect_mod_item_types] collecting item types in top-level module
#4 [analysis] running analysis passes on this crate
end of query stack

Backtrace on old rustc

error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:885:9: type parameter `T/#1` (T/1) out of range when substituting, substs=[]

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/compiler/rustc_errors/src/lib.rs:1644:9
stack backtrace:
   0:     0x7f632f91b56a - std::backtrace_rs::backtrace::libunwind::trace::h96288e3e31cede0c
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f632f91b56a - std::backtrace_rs::backtrace::trace_unsynchronized::h136276fcc921ebd2
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f632f91b56a - std::sys_common::backtrace::_print_fmt::hed1407344e09c3c5
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f632f91b56a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hef11c1a0e2ccbd67
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f632f97ba3e - core::fmt::write::h9d34c1ab82e0e30d
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/core/src/fmt/mod.rs:1232:17
   5:     0x7f632f90bb35 - std::io::Write::write_fmt::h583f259fb2d64e4c
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/std/src/io/mod.rs:1684:15
   6:     0x7f632f91b335 - std::sys_common::backtrace::_print::h384b5154a89856a1
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f632f91b335 - std::sys_common::backtrace::print::he3caeede32862700
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f632f91e0ff - std::panicking::default_hook::{{closure}}::hb37cdcd49b812817
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/std/src/panicking.rs:267:22
   9:     0x7f632f91de3b - std::panicking::default_hook::h89fa77719af1b8c7
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/std/src/panicking.rs:286:9
  10:     0x7f6332c35824 - rustc_driver_impl[996a7fa2764f51ac]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f632f91e93a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hcdabce48acce76a1
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/alloc/src/boxed.rs:2002:9
  12:     0x7f632f91e93a - std::panicking::rust_panic_with_hook::h420ef2d822c4b069
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/std/src/panicking.rs:692:13
  13:     0x7f63331b61c1 - std[cd98010995c1c111]::panicking::begin_panic::<rustc_errors[aee54022d4af98b8]::ExplicitBug>::{closure#0}
  14:     0x7f63331b60d6 - std[cd98010995c1c111]::sys_common::backtrace::__rust_end_short_backtrace::<std[cd98010995c1c111]::panicking::begin_panic<rustc_errors[aee54022d4af98b8]::ExplicitBug>::{closure#0}, !>
  15:     0x7f6333138a96 - std[cd98010995c1c111]::panicking::begin_panic::<rustc_errors[aee54022d4af98b8]::ExplicitBug>
  16:     0x7f63331d34b6 - std[cd98010995c1c111]::panic::panic_any::<rustc_errors[aee54022d4af98b8]::ExplicitBug>
  17:     0x7f63331d1686 - <rustc_errors[aee54022d4af98b8]::HandlerInner>::bug::<&alloc[d5203ca4bbacc4a0]::string::String>
  18:     0x7f63331d1360 - <rustc_errors[aee54022d4af98b8]::Handler>::bug::<&alloc[d5203ca4bbacc4a0]::string::String>
  19:     0x7f63331f038b - rustc_middle[dd44835e384dc8fc]::util::bug::opt_span_bug_fmt::<rustc_span[c7747b3aedb35767]::span_encoding::Span>::{closure#0}
  20:     0x7f63331ef64a - rustc_middle[dd44835e384dc8fc]::ty::context::tls::with_opt::<rustc_middle[dd44835e384dc8fc]::util::bug::opt_span_bug_fmt<rustc_span[c7747b3aedb35767]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f63331ef616 - rustc_middle[dd44835e384dc8fc]::ty::context::tls::with_context_opt::<rustc_middle[dd44835e384dc8fc]::ty::context::tls::with_opt<rustc_middle[dd44835e384dc8fc]::util::bug::opt_span_bug_fmt<rustc_span[c7747b3aedb35767]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f63331f02d6 - rustc_middle[dd44835e384dc8fc]::util::bug::opt_span_bug_fmt::<rustc_span[c7747b3aedb35767]::span_encoding::Span>
  23:     0x7f6330f7ab43 - rustc_middle[dd44835e384dc8fc]::util::bug::bug_fmt
  24:     0x7f63331eebae - <rustc_middle[dd44835e384dc8fc]::ty::subst::SubstFolder>::type_param_out_of_range
  25:     0x7f6330d26040 - <rustc_middle[dd44835e384dc8fc]::ty::subst::SubstFolder as rustc_middle[dd44835e384dc8fc]::ty::fold::TypeFolder>::fold_ty
  26:     0x7f63315f7d61 - rustc_ty_utils[1cc88f9ece2150ce]::instance::inner_resolve_instance
  27:     0x7f63314e8923 - <rustc_query_system[1e3d87d6bb1db1ab]::dep_graph::graph::DepGraph<rustc_middle[dd44835e384dc8fc]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[dd44835e384dc8fc]::ty::context::TyCtxt, rustc_middle[dd44835e384dc8fc]::ty::ParamEnvAnd<(rustc_span[c7747b3aedb35767]::def_id::DefId, &rustc_middle[dd44835e384dc8fc]::ty::list::List<rustc_middle[dd44835e384dc8fc]::ty::subst::GenericArg>)>, core[c2ed83ad2149f92c]::result::Result<core[c2ed83ad2149f92c]::option::Option<rustc_middle[dd44835e384dc8fc]::ty::instance::Instance>, rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>>
  28:     0x7f63314e518a - rustc_query_system[1e3d87d6bb1db1ab]::query::plumbing::get_query::<rustc_query_impl[f65b45c65392aba7]::queries::resolve_instance, rustc_query_impl[f65b45c65392aba7]::plumbing::QueryCtxt, rustc_middle[dd44835e384dc8fc]::dep_graph::dep_node::DepKind>
  29:     0x7f6331226f0a - <rustc_middle[dd44835e384dc8fc]::ty::instance::Instance>::resolve_opt_const_arg
  30:     0x7f6330fd88ec - <rustc_middle[dd44835e384dc8fc]::ty::context::TyCtxt>::const_eval_resolve_for_typeck
  31:     0x7f6330fd81b3 - <rustc_middle[dd44835e384dc8fc]::ty::consts::Const>::eval
  32:     0x7f6330fae2fb - <rustc_trait_selection[fb65b6bdc136294c]::traits::project::AssocTypeNormalizer as rustc_middle[dd44835e384dc8fc]::ty::fold::TypeFolder>::fold_const
  33:     0x7f633126f99a - <rustc_middle[dd44835e384dc8fc]::ty::sty::Binder<rustc_middle[dd44835e384dc8fc]::ty::PredicateKind> as rustc_middle[dd44835e384dc8fc]::ty::fold::TypeFoldable>::try_fold_with::<rustc_trait_selection[fb65b6bdc136294c]::traits::project::AssocTypeNormalizer>
  34:     0x7f633126f118 - <rustc_trait_selection[fb65b6bdc136294c]::traits::project::AssocTypeNormalizer as rustc_middle[dd44835e384dc8fc]::ty::fold::FallibleTypeFolder>::try_fold_predicate
  35:     0x7f6331fc8e0e - <alloc[d5203ca4bbacc4a0]::vec::Vec<rustc_middle[dd44835e384dc8fc]::ty::Predicate> as alloc[d5203ca4bbacc4a0]::vec::spec_from_iter::SpecFromIter<rustc_middle[dd44835e384dc8fc]::ty::Predicate, core[c2ed83ad2149f92c]::iter::adapters::GenericShunt<core[c2ed83ad2149f92c]::iter::adapters::map::Map<alloc[d5203ca4bbacc4a0]::vec::into_iter::IntoIter<rustc_middle[dd44835e384dc8fc]::ty::Predicate>, <alloc[d5203ca4bbacc4a0]::vec::Vec<rustc_middle[dd44835e384dc8fc]::ty::Predicate> as rustc_middle[dd44835e384dc8fc]::ty::fold::TypeFoldable>::try_fold_with<rustc_trait_selection[fb65b6bdc136294c]::traits::project::AssocTypeNormalizer>::{closure#0}>, core[c2ed83ad2149f92c]::result::Result<core[c2ed83ad2149f92c]::convert::Infallible, !>>>>::from_iter
  36:     0x7f63314a1561 - rustc_trait_selection[fb65b6bdc136294c]::traits::do_normalize_predicates
  37:     0x7f633149e7aa - rustc_trait_selection[fb65b6bdc136294c]::traits::normalize_param_env_or_error
  38:     0x7f633149d5a6 - rustc_ty_utils[1cc88f9ece2150ce]::ty::param_env
  39:     0x7f63314a7f2a - <rustc_query_system[1e3d87d6bb1db1ab]::dep_graph::graph::DepGraph<rustc_middle[dd44835e384dc8fc]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[dd44835e384dc8fc]::ty::context::TyCtxt, rustc_span[c7747b3aedb35767]::def_id::DefId, rustc_middle[dd44835e384dc8fc]::ty::ParamEnv>
  40:     0x7f633149b8be - rustc_query_system[1e3d87d6bb1db1ab]::query::plumbing::get_query::<rustc_query_impl[f65b45c65392aba7]::queries::param_env, rustc_query_impl[f65b45c65392aba7]::plumbing::QueryCtxt, rustc_middle[dd44835e384dc8fc]::dep_graph::dep_node::DepKind>
  41:     0x7f63318b1265 - rustc_hir_analysis[fafe05592f4b0540]::check::wfcheck::check_item_fn
  42:     0x7f63318ac897 - rustc_hir_analysis[fafe05592f4b0540]::check::wfcheck::check_well_formed
  43:     0x7f633138ac87 - <rustc_query_system[1e3d87d6bb1db1ab]::dep_graph::graph::DepGraph<rustc_middle[dd44835e384dc8fc]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[dd44835e384dc8fc]::ty::context::TyCtxt, rustc_hir[1050a9e997bec054]::hir_id::OwnerId, ()>
  44:     0x7f6331389d8e - rustc_query_system[1e3d87d6bb1db1ab]::query::plumbing::get_query::<rustc_query_impl[f65b45c65392aba7]::queries::check_well_formed, rustc_query_impl[f65b45c65392aba7]::plumbing::QueryCtxt, rustc_middle[dd44835e384dc8fc]::dep_graph::dep_node::DepKind>
  45:     0x7f6331f8e2e6 - rustc_data_structures[24302e2764d485f4]::sync::par_for_each_in::<&[rustc_hir[1050a9e997bec054]::hir::ImplItemId], <rustc_middle[dd44835e384dc8fc]::hir::ModuleItems>::par_impl_items<rustc_hir_analysis[fafe05592f4b0540]::check::wfcheck::check_mod_type_wf::{closure#1}>::{closure#0}>
  46:     0x7f6331f8df92 - rustc_hir_analysis[fafe05592f4b0540]::check::wfcheck::check_mod_type_wf
  47:     0x7f63314ccc57 - <rustc_query_system[1e3d87d6bb1db1ab]::dep_graph::graph::DepGraph<rustc_middle[dd44835e384dc8fc]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[dd44835e384dc8fc]::ty::context::TyCtxt, rustc_span[c7747b3aedb35767]::def_id::LocalDefId, ()>
  48:     0x7f633216e823 - rustc_query_system[1e3d87d6bb1db1ab]::query::plumbing::try_execute_query::<rustc_query_impl[f65b45c65392aba7]::queries::check_mod_type_wf, rustc_query_impl[f65b45c65392aba7]::plumbing::QueryCtxt>
  49:     0x7f633216e12d - <rustc_query_impl[f65b45c65392aba7]::Queries as rustc_middle[dd44835e384dc8fc]::ty::query::QueryEngine>::check_mod_type_wf
  50:     0x7f6332083658 - rustc_data_structures[24302e2764d485f4]::sync::par_for_each_in::<&[rustc_hir[1050a9e997bec054]::hir_id::OwnerId], <rustc_middle[dd44835e384dc8fc]::hir::map::Map>::par_for_each_module<rustc_hir_analysis[fafe05592f4b0540]::check_crate::{closure#5}::{closure#0}::{closure#0}>::{closure#0}>
  51:     0x7f633208349a - <rustc_session[8b3af3d4e67ba61e]::session::Session>::track_errors::<rustc_hir_analysis[fafe05592f4b0540]::check_crate::{closure#5}, ()>
  52:     0x7f6332080da2 - rustc_hir_analysis[fafe05592f4b0540]::check_crate
  53:     0x7f633207b034 - rustc_interface[82796a5553273f34]::passes::analysis
  54:     0x7f63323d40f6 - <rustc_query_system[1e3d87d6bb1db1ab]::dep_graph::graph::DepGraph<rustc_middle[dd44835e384dc8fc]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[dd44835e384dc8fc]::ty::context::TyCtxt, (), core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>>
  55:     0x7f63323d3701 - rustc_query_system[1e3d87d6bb1db1ab]::query::plumbing::try_execute_query::<rustc_query_impl[f65b45c65392aba7]::queries::analysis, rustc_query_impl[f65b45c65392aba7]::plumbing::QueryCtxt>
  56:     0x7f63325c943a - <rustc_query_impl[f65b45c65392aba7]::Queries as rustc_middle[dd44835e384dc8fc]::ty::query::QueryEngine>::analysis
  57:     0x7f63322d5ad7 - <rustc_interface[82796a5553273f34]::passes::QueryContext>::enter::<rustc_driver_impl[996a7fa2764f51ac]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>>
  58:     0x7f6331e22602 - <rustc_interface[82796a5553273f34]::interface::Compiler>::enter::<rustc_driver_impl[996a7fa2764f51ac]::run_compiler::{closure#1}::{closure#2}, core[c2ed83ad2149f92c]::result::Result<core[c2ed83ad2149f92c]::option::Option<rustc_interface[82796a5553273f34]::queries::Linker>, rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>>
  59:     0x7f6331e1d694 - rustc_span[c7747b3aedb35767]::with_source_map::<core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>, rustc_interface[82796a5553273f34]::interface::run_compiler<core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>, rustc_driver_impl[996a7fa2764f51ac]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  60:     0x7f6331e1d1a4 - <scoped_tls[2e89e8a69196fbc0]::ScopedKey<rustc_span[c7747b3aedb35767]::SessionGlobals>>::set::<rustc_interface[82796a5553273f34]::interface::run_compiler<core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>, rustc_driver_impl[996a7fa2764f51ac]::run_compiler::{closure#1}>::{closure#0}, core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>>
  61:     0x7f6331e1c8a2 - std[cd98010995c1c111]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[82796a5553273f34]::util::run_in_thread_pool_with_globals<rustc_interface[82796a5553273f34]::interface::run_compiler<core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>, rustc_driver_impl[996a7fa2764f51ac]::run_compiler::{closure#1}>::{closure#0}, core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>>
  62:     0x7f63324e127a - <<std[cd98010995c1c111]::thread::Builder>::spawn_unchecked_<rustc_interface[82796a5553273f34]::util::run_in_thread_pool_with_globals<rustc_interface[82796a5553273f34]::interface::run_compiler<core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>, rustc_driver_impl[996a7fa2764f51ac]::run_compiler::{closure#1}>::{closure#0}, core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c2ed83ad2149f92c]::result::Result<(), rustc_errors[aee54022d4af98b8]::ErrorGuaranteed>>::{closure#1} as core[c2ed83ad2149f92c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  63:     0x7f632f928933 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h125a8995d683d283
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/alloc/src/boxed.rs:1988:9
  64:     0x7f632f928933 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc8d7e704b7a14a23
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/alloc/src/boxed.rs:1988:9
  65:     0x7f632f928933 - std::sys::unix::thread::Thread::new::thread_start::hc8f4f2c9b0ce4632
                               at /rustc/8996ea93b6e554148c4286e62b613f12a3ee505c/library/std/src/sys/unix/thread.rs:108:17
  66:     0x7f632f65eb43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  67:     0x7f632f6f0a00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  68:                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: rustc 1.69.0-nightly (8996ea93b 2023-02-09) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -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 [resolve_instance] resolving instance `main::{constant#0}`
#1 [param_env] computing normalized predicates of `main`
#2 [check_well_formed] checking that `main` is well-formed
#3 [check_mod_type_wf] checking that types are well-formed in top-level module
#4 [analysis] running analysis passes on this crate
end of query stack

Metadata

Metadata

Assignees

Labels

A-const-genericsArea: const generics (parameters and arguments)C-bugCategory: This is a bug.F-associated_const_equality`#![feature(associated_const_equality)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions