Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE(non_lifetime_binders): const bound params not handled correctly #127009

Closed
camelid opened this issue Jun 26, 2024 · 3 comments · Fixed by #128020
Closed

ICE(non_lifetime_binders): const bound params not handled correctly #127009

camelid opened this issue Jun 26, 2024 · 3 comments · Fixed by #128020
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-non_lifetime_binders `#![feature(non_lifetime_binders)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features This issue requires the use of incomplete features. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@camelid
Copy link
Member

camelid commented Jun 26, 2024

After #125915 is merged, this code from the testsuite for the incomplete non_lifetime_binders feature will ICE instead of erroring. This was decided to be acceptable for now.

#![feature(non_lifetime_binders)]
//~^ WARN the feature `non_lifetime_binders` is incomplete

fn b()
where
    for<const C: usize> [(); C]: Copy,
    //~^ ERROR cannot capture late-bound const parameter in constant
{
}

fn main() {}
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
 --> tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.rs:1:12
  |
1 | #![feature(non_lifetime_binders)]
  |            ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
  = note: `#[warn(incomplete_features)]` on by default

error: internal compiler error: compiler/rustc_trait_selection/src/traits/select/mod.rs:1012:29: placeholder const !1_0 in old solver

thread 'rustc' panicked at compiler/rustc_trait_selection/src/traits/select/mod.rs:1012:29:
Box<dyn Any>
stack backtrace:
   0:     0x725d5f583909 - <std::sys::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3d604e838293ed68
   1:     0x725d5f5dcb2b - core::fmt::write::h110152b3d18eaf0f
   2:     0x725d5f55208f - std::io::Write::write_fmt::h6097083ff26d17ba
   3:     0x725d5f583732 - std::sys::backtrace::print::h344df78f7e8de3b6
   4:     0x725d5f56b189 - std::panicking::default_hook::{{closure}}::h9af8086f92441121
   5:     0x725d5f56af71 - std::panicking::default_hook::h3cccee80c4906104
   6:     0x725d610011c7 - <alloc[744cf86df9f16227]::boxed::Box<rustc_driver_impl[e06de9af26686a5d]::install_ice_hook::{closure#0}> as core[27dfedca8d778a58]::ops::function::Fn<(&dyn for<'a, 'b> core[27dfedca8d778a58]::ops::function::Fn<(&'a std[2e9ec11aff152b34]::panic::PanicHookInfo<'b>,), Output = ()> + core[27dfedca8d778a58]::marker::Sync + core[27dfedca8d778a58]::marker::Send, &std[2e9ec11aff152b34]::panic::PanicHookInfo)>>::call
   7:     0x725d5f56b7ef - std::panicking::rust_panic_with_hook::hbb623212c20ce075
   8:     0x725d63e48c83 - std[2e9ec11aff152b34]::panicking::begin_panic::<rustc_errors[51f3546eabc4d183]::ExplicitBug>::{closure#0}
   9:     0x725d63e48c36 - std[2e9ec11aff152b34]::sys::backtrace::__rust_end_short_backtrace::<std[2e9ec11aff152b34]::panicking::begin_panic<rustc_errors[51f3546eabc4d183]::ExplicitBug>::{closure#0}, !>
  10:     0x725d63e185a6 - std[2e9ec11aff152b34]::panicking::begin_panic::<rustc_errors[51f3546eabc4d183]::ExplicitBug>
  11:     0x725d63e11b56 - std[2e9ec11aff152b34]::panic::panic_any::<rustc_errors[51f3546eabc4d183]::ExplicitBug>
  12:     0x725d63e11d41 - <rustc_errors[51f3546eabc4d183]::diagnostic::BugAbort as rustc_errors[51f3546eabc4d183]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  13:     0x725d63b70977 - <rustc_errors[51f3546eabc4d183]::diagnostic::Diag<rustc_errors[51f3546eabc4d183]::diagnostic::BugAbort>>::emit
  14:     0x725d63c82e97 - <rustc_errors[51f3546eabc4d183]::DiagCtxtHandle>::bug::<alloc[744cf86df9f16227]::string::String>
  15:     0x725d63ab18b3 - rustc_middle[b180dbf6a2c53ecd]::util::bug::opt_span_bug_fmt::<rustc_span[9419f05dd464063d]::span_encoding::Span>::{closure#0}
  16:     0x725d63ab175a - rustc_middle[b180dbf6a2c53ecd]::ty::context::tls::with_opt::<rustc_middle[b180dbf6a2c53ecd]::util::bug::opt_span_bug_fmt<rustc_span[9419f05dd464063d]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  17:     0x725d63ab1700 - rustc_middle[b180dbf6a2c53ecd]::ty::context::tls::with_context_opt::<rustc_middle[b180dbf6a2c53ecd]::ty::context::tls::with_opt<rustc_middle[b180dbf6a2c53ecd]::util::bug::opt_span_bug_fmt<rustc_span[9419f05dd464063d]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  18:     0x725d63ab1706 - rustc_middle[b180dbf6a2c53ecd]::ty::context::tls::with_opt::<rustc_middle[b180dbf6a2c53ecd]::util::bug::opt_span_bug_fmt<rustc_span[9419f05dd464063d]::span_encoding::Span>::{closure#0}, !>
  19:     0x725d63ab17dc - rustc_middle[b180dbf6a2c53ecd]::util::bug::opt_span_bug_fmt::<rustc_span[9419f05dd464063d]::span_encoding::Span>
  20:     0x725d63c7a99f - rustc_middle[b180dbf6a2c53ecd]::util::bug::bug_fmt
  21:     0x725d63024af5 - <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_predicate_recursively
  22:     0x725d62ff3fe9 - <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_predicates_recursively::<alloc[744cf86df9f16227]::vec::into_iter::IntoIter<rustc_infer[212acad4aa1efbc2]::traits::Obligation<rustc_middle[b180dbf6a2c53ecd]::ty::predicate::Predicate>>>
  23:     0x725d62f4b076 - <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_candidate::{closure#0}::{closure#0}>::{closure#0}
  24:     0x725d62f3073d - <rustc_infer[212acad4aa1efbc2]::infer::InferCtxt>::probe::<core[27dfedca8d778a58]::result::Result<rustc_middle[b180dbf6a2c53ecd]::traits::select::EvaluationResult, rustc_middle[b180dbf6a2c53ecd]::traits::select::OverflowError>, <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluation_probe<<rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_candidate::{closure#0}::{closure#0}>::{closure#0}>
  25:     0x725d63027797 - <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_candidate
  26:     0x725d6300f2ad - <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_stack
  27:     0x725d62e9a74a - <rustc_query_system[60e86d9040c1a327]::dep_graph::graph::DepGraph<rustc_middle[b180dbf6a2c53ecd]::dep_graph::DepsType>>::with_anon_task::<rustc_middle[b180dbf6a2c53ecd]::ty::context::TyCtxt, <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::in_task<<rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_trait_predicate_recursively::{closure#0}::{closure#1}, core[27dfedca8d778a58]::result::Result<rustc_middle[b180dbf6a2c53ecd]::traits::select::EvaluationResult, rustc_middle[b180dbf6a2c53ecd]::traits::select::OverflowError>>::{closure#0}, core[27dfedca8d778a58]::result::Result<rustc_middle[b180dbf6a2c53ecd]::traits::select::EvaluationResult, rustc_middle[b180dbf6a2c53ecd]::traits::select::OverflowError>>
  28:     0x725d62ff3138 - <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::in_task::<<rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_trait_predicate_recursively::{closure#0}::{closure#1}, core[27dfedca8d778a58]::result::Result<rustc_middle[b180dbf6a2c53ecd]::traits::select::EvaluationResult, rustc_middle[b180dbf6a2c53ecd]::traits::select::OverflowError>>
  29:     0x725d6302598d - <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
  30:     0x725d630237fd - <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_predicate_recursively
  31:     0x725d62f4b48a - <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>::{closure#0}
  32:     0x725d62f30bc2 - <rustc_infer[212acad4aa1efbc2]::infer::InferCtxt>::probe::<core[27dfedca8d778a58]::result::Result<rustc_middle[b180dbf6a2c53ecd]::traits::select::EvaluationResult, rustc_middle[b180dbf6a2c53ecd]::traits::select::OverflowError>, <rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluation_probe<<rustc_trait_selection[bc7c9beecb4e0332]::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>::{closure#0}>
  33:     0x725d62173d19 - rustc_traits[83c42f70a0da4bea]::evaluate_obligation::evaluate_obligation
  34:     0x725d6283b545 - rustc_query_impl[6c0288a9c5faeaab]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[6c0288a9c5faeaab]::query_impl::evaluate_obligation::dynamic_query::{closure#2}::{closure#0}, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 2usize]>>
  35:     0x725d627cce87 - <rustc_query_impl[6c0288a9c5faeaab]::query_impl::evaluate_obligation::dynamic_query::{closure#2} as core[27dfedca8d778a58]::ops::function::FnOnce<(rustc_middle[b180dbf6a2c53ecd]::ty::context::TyCtxt, rustc_type_ir[f87c7fc52f22c965]::canonical::Canonical<rustc_middle[b180dbf6a2c53ecd]::ty::context::TyCtxt, rustc_middle[b180dbf6a2c53ecd]::ty::ParamEnvAnd<rustc_middle[b180dbf6a2c53ecd]::ty::predicate::Predicate>>)>>::call_once
  36:     0x725d62b8cc13 - <std[2e9ec11aff152b34]::thread::local::LocalKey<core[27dfedca8d778a58]::cell::Cell<*const ()>>>::with::<rustc_middle[b180dbf6a2c53ecd]::ty::context::tls::enter_context<rustc_query_system[60e86d9040c1a327]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[6c0288a9c5faeaab]::DynamicConfig<rustc_query_system[60e86d9040c1a327]::query::caches::DefaultCache<rustc_type_ir[f87c7fc52f22c965]::canonical::Canonical<rustc_middle[b180dbf6a2c53ecd]::ty::context::TyCtxt, rustc_middle[b180dbf6a2c53ecd]::ty::ParamEnvAnd<rustc_middle[b180dbf6a2c53ecd]::ty::predicate::Predicate>>, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[6c0288a9c5faeaab]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 2usize]>>::{closure#0}, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 2usize]>>
  37:     0x725d62938533 - rustc_query_system[60e86d9040c1a327]::query::plumbing::try_execute_query::<rustc_query_impl[6c0288a9c5faeaab]::DynamicConfig<rustc_query_system[60e86d9040c1a327]::query::caches::DefaultCache<rustc_type_ir[f87c7fc52f22c965]::canonical::Canonical<rustc_middle[b180dbf6a2c53ecd]::ty::context::TyCtxt, rustc_middle[b180dbf6a2c53ecd]::ty::ParamEnvAnd<rustc_middle[b180dbf6a2c53ecd]::ty::predicate::Predicate>>, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[6c0288a9c5faeaab]::plumbing::QueryCtxt, false>
  38:     0x725d627cd639 - rustc_query_impl[6c0288a9c5faeaab]::query_impl::evaluate_obligation::get_query_non_incr::__rust_end_short_backtrace
  39:     0x725d62ffb6e1 - <rustc_infer[212acad4aa1efbc2]::infer::InferCtxt as rustc_trait_selection[bc7c9beecb4e0332]::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
  40:     0x725d62ffb82b - <rustc_infer[212acad4aa1efbc2]::infer::InferCtxt as rustc_trait_selection[bc7c9beecb4e0332]::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
  41:     0x725d62fb7b21 - <rustc_trait_selection[bc7c9beecb4e0332]::traits::fulfill::FulfillProcessor>::process_trait_obligation
  42:     0x725d62fb600e - <rustc_trait_selection[bc7c9beecb4e0332]::traits::fulfill::FulfillProcessor as rustc_data_structures[b93d67414d82d706]::obligation_forest::ObligationProcessor>::process_obligation
  43:     0x725d62fe4949 - <rustc_data_structures[b93d67414d82d706]::obligation_forest::ObligationForest<rustc_trait_selection[bc7c9beecb4e0332]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[bc7c9beecb4e0332]::traits::fulfill::FulfillProcessor>
  44:     0x725d62fd3795 - <rustc_trait_selection[bc7c9beecb4e0332]::traits::fulfill::FulfillmentContext<rustc_infer[212acad4aa1efbc2]::traits::engine::ScrubbedTraitError> as rustc_infer[212acad4aa1efbc2]::traits::engine::TraitEngine<rustc_infer[212acad4aa1efbc2]::traits::engine::ScrubbedTraitError>>::select_where_possible
  45:     0x725d62fd2b0c - <rustc_trait_selection[bc7c9beecb4e0332]::traits::fulfill::FulfillmentContext<rustc_infer[212acad4aa1efbc2]::traits::engine::ScrubbedTraitError> as rustc_infer[212acad4aa1efbc2]::traits::engine::TraitEngine<rustc_infer[212acad4aa1efbc2]::traits::engine::ScrubbedTraitError>>::select_all_or_error
  46:     0x725d63073f27 - <rustc_trait_selection[bc7c9beecb4e0332]::traits::engine::ObligationCtxt>::select_all_or_error
  47:     0x725d62ffc895 - rustc_trait_selection[bc7c9beecb4e0332]::traits::impossible_predicates
  48:     0x725d61b2c998 - rustc_mir_transform[5f52da1b72eaa738]::mir_drops_elaborated_and_const_checked
  49:     0x725d62849675 - rustc_query_impl[6c0288a9c5faeaab]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[6c0288a9c5faeaab]::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 8usize]>>
  50:     0x725d627d139c - <rustc_query_impl[6c0288a9c5faeaab]::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2} as core[27dfedca8d778a58]::ops::function::FnOnce<(rustc_middle[b180dbf6a2c53ecd]::ty::context::TyCtxt, rustc_span[9419f05dd464063d]::def_id::LocalDefId)>>::call_once
  51:     0x725d62b8d326 - <std[2e9ec11aff152b34]::thread::local::LocalKey<core[27dfedca8d778a58]::cell::Cell<*const ()>>>::with::<rustc_middle[b180dbf6a2c53ecd]::ty::context::tls::enter_context<rustc_query_system[60e86d9040c1a327]::query::plumbing::execute_job_non_incr<rustc_query_impl[6c0288a9c5faeaab]::DynamicConfig<rustc_query_system[60e86d9040c1a327]::query::caches::DefaultCache<rustc_span[9419f05dd464063d]::symbol::Symbol, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[6c0288a9c5faeaab]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 8usize]>>
  52:     0x725d62980759 - rustc_query_system[60e86d9040c1a327]::query::plumbing::try_execute_query::<rustc_query_impl[6c0288a9c5faeaab]::DynamicConfig<rustc_query_system[60e86d9040c1a327]::query::caches::VecCache<rustc_span[9419f05dd464063d]::def_id::LocalDefId, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[6c0288a9c5faeaab]::plumbing::QueryCtxt, false>
  53:     0x725d629b2f37 - rustc_query_impl[6c0288a9c5faeaab]::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
  54:     0x725d61270b73 - <rustc_session[7307c4cb2f95ec76]::session::Session>::time::<(), rustc_interface[771ef826278f015c]::passes::run_required_analyses::{closure#2}>
  55:     0x725d6124c7e4 - rustc_interface[771ef826278f015c]::passes::analysis
  56:     0x725d6284b6d3 - rustc_query_impl[6c0288a9c5faeaab]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[6c0288a9c5faeaab]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 1usize]>>
  57:     0x725d628c9888 - <rustc_query_impl[6c0288a9c5faeaab]::query_impl::analysis::dynamic_query::{closure#2} as core[27dfedca8d778a58]::ops::function::FnOnce<(rustc_middle[b180dbf6a2c53ecd]::ty::context::TyCtxt, ())>>::call_once
  58:     0x725d62b8c240 - <std[2e9ec11aff152b34]::thread::local::LocalKey<core[27dfedca8d778a58]::cell::Cell<*const ()>>>::with::<rustc_middle[b180dbf6a2c53ecd]::ty::context::tls::enter_context<rustc_query_system[60e86d9040c1a327]::query::plumbing::execute_job_non_incr<rustc_query_impl[6c0288a9c5faeaab]::DynamicConfig<rustc_query_system[60e86d9040c1a327]::query::caches::SingleCache<rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[6c0288a9c5faeaab]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 1usize]>>::{closure#0}, rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 1usize]>>
  59:     0x725d6291a20a - rustc_query_system[60e86d9040c1a327]::query::plumbing::try_execute_query::<rustc_query_impl[6c0288a9c5faeaab]::DynamicConfig<rustc_query_system[60e86d9040c1a327]::query::caches::SingleCache<rustc_middle[b180dbf6a2c53ecd]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[6c0288a9c5faeaab]::plumbing::QueryCtxt, false>
  60:     0x725d628b10c3 - rustc_query_impl[6c0288a9c5faeaab]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  61:     0x725d610193a3 - <std[2e9ec11aff152b34]::thread::local::LocalKey<core[27dfedca8d778a58]::cell::Cell<*const ()>>>::with::<rustc_middle[b180dbf6a2c53ecd]::ty::context::tls::enter_context<<rustc_middle[b180dbf6a2c53ecd]::ty::context::GlobalCtxt>::enter<rustc_driver_impl[e06de9af26686a5d]::run_compiler::{closure#0}::{closure#1}::{closure#5}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#1}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#0}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>
  62:     0x725d610187de - <rustc_middle[b180dbf6a2c53ecd]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[e06de9af26686a5d]::run_compiler::{closure#0}::{closure#1}::{closure#5}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>
  63:     0x725d6101f21a - <rustc_interface[771ef826278f015c]::interface::Compiler>::enter::<rustc_driver_impl[e06de9af26686a5d]::run_compiler::{closure#0}::{closure#1}, core[27dfedca8d778a58]::result::Result<core[27dfedca8d778a58]::option::Option<rustc_interface[771ef826278f015c]::queries::Linker>, rustc_span[9419f05dd464063d]::ErrorGuaranteed>>
  64:     0x725d60fec42f - <scoped_tls[b71fe80a0fab2a4]::ScopedKey<rustc_span[9419f05dd464063d]::SessionGlobals>>::set::<rustc_interface[771ef826278f015c]::util::run_in_thread_with_globals<rustc_interface[771ef826278f015c]::util::run_in_thread_pool_with_globals<rustc_interface[771ef826278f015c]::interface::run_compiler<core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>, rustc_driver_impl[e06de9af26686a5d]::run_compiler::{closure#0}>::{closure#1}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#0}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>
  65:     0x725d60fea8ef - rustc_span[9419f05dd464063d]::create_session_globals_then::<core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>, rustc_interface[771ef826278f015c]::util::run_in_thread_with_globals<rustc_interface[771ef826278f015c]::util::run_in_thread_pool_with_globals<rustc_interface[771ef826278f015c]::interface::run_compiler<core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>, rustc_driver_impl[e06de9af26686a5d]::run_compiler::{closure#0}>::{closure#1}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#0}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
  66:     0x725d61013d52 - std[2e9ec11aff152b34]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[771ef826278f015c]::util::run_in_thread_with_globals<rustc_interface[771ef826278f015c]::util::run_in_thread_pool_with_globals<rustc_interface[771ef826278f015c]::interface::run_compiler<core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>, rustc_driver_impl[e06de9af26686a5d]::run_compiler::{closure#0}>::{closure#1}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#0}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>
  67:     0x725d610116e4 - std[2e9ec11aff152b34]::panicking::try::<core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>, core[27dfedca8d778a58]::panic::unwind_safe::AssertUnwindSafe<<std[2e9ec11aff152b34]::thread::Builder>::spawn_unchecked_<rustc_interface[771ef826278f015c]::util::run_in_thread_with_globals<rustc_interface[771ef826278f015c]::util::run_in_thread_pool_with_globals<rustc_interface[771ef826278f015c]::interface::run_compiler<core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>, rustc_driver_impl[e06de9af26686a5d]::run_compiler::{closure#0}>::{closure#1}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#0}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#2}::{closure#0}>>
  68:     0x725d61017b3d - <<std[2e9ec11aff152b34]::thread::Builder>::spawn_unchecked_<rustc_interface[771ef826278f015c]::util::run_in_thread_with_globals<rustc_interface[771ef826278f015c]::util::run_in_thread_pool_with_globals<rustc_interface[771ef826278f015c]::interface::run_compiler<core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>, rustc_driver_impl[e06de9af26686a5d]::run_compiler::{closure#0}>::{closure#1}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#0}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[27dfedca8d778a58]::result::Result<(), rustc_span[9419f05dd464063d]::ErrorGuaranteed>>::{closure#2} as core[27dfedca8d778a58]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  69:     0x725d5f55e10d - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h639c9f775cba13c4
  70:     0x725d5f55e4ec - std::sys::pal::unix::thread::Thread::new::thread_start::h30eedc2c384f6c7b
  71:     0x725d5f294ac3 - start_thread
                               at ./nptl/pthread_create.c:442:8
  72:     0x725d5f326850 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  73:                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: please attach the file at `/home/noahlev/code/rust/r2/rustc-ice-2024-06-26T21_41_09-2600807.txt` to your bug report

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `[(); ^0]: core::marker::Copy`
#1 [mir_drops_elaborated_and_const_checked] elaborating drops for `b`
end of query stack
error: aborting due to 1 previous error; 1 warning emitted


Note that for some reason the ICE message is different when run with compiletest:

warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
  --> /home/noahlev/code/rust/r2/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.rs:1:12
   |
LL | #![feature(non_lifetime_binders)]
   |            ^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
   = note: `#[warn(incomplete_features)]` on by default

warning: 1 warning emitted

note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: ty::ConstKind::Error constructed but no error reported
   |
   = note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:362:32
              0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
              1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
              2: <rustc_errors::diagnostic::Diag>::emit_producing_error_guaranteed
              3: <rustc_middle::ty::consts::Const>::new_error_with_message::<rustc_span::span_encoding::Span>
              4: <rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}::ConstNormalizer as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_const
              5: <rustc_middle::ty::Ty as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::super_fold_with::<rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}::ConstNormalizer>
              6: <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}::ConstNormalizer>
              7: <rustc_type_ir::predicate::TraitPredicate<rustc_middle::ty::context::TyCtxt> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}::ConstNormalizer>
              8: <rustc_type_ir::predicate_kind::PredicateKind<rustc_middle::ty::context::TyCtxt> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}::ConstNormalizer>
              9: <rustc_type_ir::binder::Binder<rustc_middle::ty::context::TyCtxt, rustc_type_ir::predicate_kind::PredicateKind<rustc_middle::ty::context::TyCtxt>> as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::super_fold_with::<rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}::ConstNormalizer>
             10: <rustc_middle::ty::predicate::Predicate as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::super_fold_with::<rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}::ConstNormalizer>
             11: <core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::predicate::Clause>> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::adapters::map::map_try_fold<rustc_middle::ty::predicate::Clause, rustc_middle::ty::predicate::Clause, (), core::ops::control_flow::ControlFlow<rustc_middle::ty::predicate::Clause>, rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}, core::iter::traits::iterator::Iterator::find::check<rustc_middle::ty::predicate::Clause, &mut <rustc_infer::traits::util::Elaborator<rustc_middle::ty::predicate::Clause>>::extend_deduped<core::iter::adapters::map::Map<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::predicate::Clause>>, rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}>>::{closure#0}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_middle::ty::predicate::Clause>>
             12: <alloc::vec::Vec<rustc_middle::ty::predicate::Clause> as alloc::vec::spec_extend::SpecExtend<rustc_middle::ty::predicate::Clause, core::iter::adapters::filter::Filter<core::iter::adapters::map::Map<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::predicate::Clause>>, rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}>, <rustc_infer::traits::util::Elaborator<rustc_middle::ty::predicate::Clause>>::extend_deduped<core::iter::adapters::map::Map<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::predicate::Clause>>, rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}>>::{closure#0}>>>::spec_extend
             13: rustc_infer::traits::util::elaborate::<rustc_middle::ty::predicate::Clause, core::iter::adapters::map::Map<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::predicate::Clause>>, rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}>>
             14: rustc_trait_selection::traits::normalize_param_env_or_error
             15: rustc_ty_utils::ty::param_env
             16: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::param_env::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
             17: <rustc_query_impl::query_impl::param_env::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
             18: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
             19: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
             20: rustc_query_impl::query_impl::param_env::get_query_non_incr::__rust_end_short_backtrace
             21: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>>
             22: rustc_hir_analysis::check::wfcheck::enter_wf_checking_ctxt::<rustc_hir_analysis::check::wfcheck::check_item_fn::{closure#0}>
             23: rustc_hir_analysis::check::wfcheck::check_well_formed
             24: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
             25: <rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_hir::hir_id::OwnerId)>>::call_once
             26: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_non_incr<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
             27: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
             28: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
             29: rustc_middle::query::plumbing::query_ensure_error_guaranteed::<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, ()>
             30: std::panicking::try::<core::result::Result<(), rustc_span::ErrorGuaranteed>, core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir::hir::ImplItemId], rustc_span::ErrorGuaranteed, <rustc_middle::hir::ModuleItems>::par_impl_items<rustc_hir_analysis::check::wfcheck::check_mod_type_wf::{closure#1}>::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>>
             31: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_data_structures::sync::parallel::enabled::try_par_for_each_in<&[rustc_hir::hir::ItemId], rustc_span::ErrorGuaranteed, <rustc_middle::hir::ModuleItems>::par_items<rustc_hir_analysis::check::wfcheck::check_mod_type_wf::{closure#0}>::{closure#0}>::{closure#0}::{closure#2}::{closure#0}>
             32: rustc_data_structures::sync::parallel::enabled::try_par_for_each_in::<&[rustc_hir::hir::ItemId], rustc_span::ErrorGuaranteed, <rustc_middle::hir::ModuleItems>::par_items<rustc_hir_analysis::check::wfcheck::check_mod_type_wf::{closure#0}>::{closure#0}>
             33: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
             34: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
             35: <rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalModDefId)>>::call_once
             36: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_non_incr<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
             37: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
             38: rustc_query_impl::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
             39: <rustc_middle::hir::map::Map>::par_for_each_module::<rustc_hir_analysis::check_crate::{closure#0}::{closure#0}>::{closure#0}
             40: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], <rustc_middle::hir::map::Map>::par_for_each_module<rustc_hir_analysis::check_crate::{closure#0}::{closure#0}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>>
             41: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], <rustc_middle::hir::map::Map>::par_for_each_module<rustc_hir_analysis::check_crate::{closure#0}::{closure#0}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>
             42: rustc_data_structures::sync::parallel::enabled::par_for_each_in::<&rustc_hir::hir_id::OwnerId, &[rustc_hir::hir_id::OwnerId], <rustc_middle::hir::map::Map>::par_for_each_module<rustc_hir_analysis::check_crate::{closure#0}::{closure#0}>::{closure#0}>
             43: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#0}>
             44: rustc_hir_analysis::check_crate
             45: rustc_interface::passes::analysis
             46: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
             47: <rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, ())>>::call_once
             48: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_non_incr<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
             49: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
             50: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
             51: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#5}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             52: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#5}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             53: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             54: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             55: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
             56: std::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             57: std::panicking::try::<core::result::Result<(), rustc_span::ErrorGuaranteed>, core::panic::unwind_safe::AssertUnwindSafe<<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#2}::{closure#0}>>
             58: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#2} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             59: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             60: std::sys::pal::unix::thread::Thread::new::thread_start
             61: start_thread
                        at ./nptl/pthread_create.c:442:8
             62: __GI___clone3
                        at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
           

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.81.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/home/noahlev/.cargo -Z ignore-directory-in-diagnostics-source-blocks=/home/noahlev/code/rust/r2/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
end of query stack

cc @BoxyUwU

@camelid camelid added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-const-generics Area: const generics (parameters and arguments) F-non_lifetime_binders `#![feature(non_lifetime_binders)]` labels Jun 26, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 26, 2024
@camelid camelid added the requires-incomplete-features This issue requires the use of incomplete features. label Jun 26, 2024
@BoxyUwU
Copy link
Member

BoxyUwU commented Jun 26, 2024

Will make sure to actually check there's not something trivial we can do to make this work before merging the PR but for now this is nice to not block a passing CI ✨

@compiler-errors
Copy link
Member

Fixing this the right way would require adding where clauses to binders (so we can put constparamty preds on the binders). Maybe I should just bite the bullet and do that 💀

@compiler-errors
Copy link
Member

compiler-errors commented Jun 27, 2024

Would be fine if we just outright denied consts from non-lifetime-binders for the moment tho. There's never a case where they work currently, and adding support for them (compared to types) was just a fun addition when I impl'd it.

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 30, 2024
Represent type-level consts with new-and-improved `hir::ConstArg`

This is a step toward `min_generic_const_exprs`.

r? `@BoxyUwU`

Things to followup on after this PR:

- rust-lang#127009
- if path in generic args doesn't resolve as type, try to resolve as const instead (do this in rustc_resolve). then remove the special-casing from rustc_ast_lowering, and then all params will be lowered as ConstArgKind::Path
- (?) consider making const_evaluatable_unchecked a hard error, or at least trying it in crater
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 5, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 11, 2024
Represent type-level consts with new-and-improved `hir::ConstArg`

This is a step toward `min_generic_const_exprs`.

r? `@BoxyUwU`

Things to followup on after this PR:

- rust-lang#127009
- if path in generic args doesn't resolve as type, try to resolve as const instead (do this in rustc_resolve). then remove the special-casing from rustc_ast_lowering, and then all params will be lowered as ConstArgKind::Path
- (?) consider making const_evaluatable_unchecked a hard error, or at least trying it in crater
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 11, 2024
Represent type-level consts with new-and-improved `hir::ConstArg`

This is a step toward `min_generic_const_exprs`.

r? `@BoxyUwU`

Things to followup on after this PR:

- rust-lang#127009
- if path in generic args doesn't resolve as type, try to resolve as const instead (do this in rustc_resolve). then remove the special-casing from rustc_ast_lowering, and then all params will be lowered as ConstArgKind::Path
- (?) consider making const_evaluatable_unchecked a hard error, or at least trying it in crater
camelid added a commit to camelid/rust that referenced this issue Jul 17, 2024
This is a very large commit since a lot needs to be changed in order to
make the tests pass. The salient changes are:

- `ConstArgKind` gets a new `Path` variant, and all const params are now
  represented using it. Non-param paths still use `ConstArgKind::Anon`
  to prevent this change from getting too large, but they will soon use
  the `Path` variant too.

- `ConstArg` gets a distinct `hir_id` field and its own variant in
  `hir::Node`. This affected many parts of the compiler that expected
  the parent of an `AnonConst` to be the containing context (e.g., an
  array repeat expression). They have been changed to check the
  "grandparent" where necessary.

- Some `ast::AnonConst`s now have their `DefId`s created in
  rustc_ast_lowering rather than `DefCollector`. This is because in some
  cases they will end up becoming a `ConstArgKind::Path` instead, which
  has no `DefId`. We have to solve this in a hacky way where we guess
  whether the `AnonConst` could end up as a path const since we can't
  know for sure until after name resolution (`N` could refer to a free
  const or a nullary struct). If it has no chance as being a const
  param, then we create a `DefId` in `DefCollector` -- otherwise we
  decide during ast_lowering. This will have to be updated once all path
  consts use `ConstArgKind::Path`.

- We explicitly use `ConstArgHasType` for array lengths, rather than
  implicitly relying on anon const type feeding -- this is due to the
  addition of `ConstArgKind::Path`.

- Some tests have their outputs changed, but the changes are for the
  most part minor (including removing duplicate or almost-duplicate
  errors). One test now ICEs, but it is for an incomplete, unstable
  feature and is now tracked at rust-lang#127009.
camelid added a commit to camelid/rust that referenced this issue Jul 17, 2024
This is a very large commit since a lot needs to be changed in order to
make the tests pass. The salient changes are:

- `ConstArgKind` gets a new `Path` variant, and all const params are now
  represented using it. Non-param paths still use `ConstArgKind::Anon`
  to prevent this change from getting too large, but they will soon use
  the `Path` variant too.

- `ConstArg` gets a distinct `hir_id` field and its own variant in
  `hir::Node`. This affected many parts of the compiler that expected
  the parent of an `AnonConst` to be the containing context (e.g., an
  array repeat expression). They have been changed to check the
  "grandparent" where necessary.

- Some `ast::AnonConst`s now have their `DefId`s created in
  rustc_ast_lowering rather than `DefCollector`. This is because in some
  cases they will end up becoming a `ConstArgKind::Path` instead, which
  has no `DefId`. We have to solve this in a hacky way where we guess
  whether the `AnonConst` could end up as a path const since we can't
  know for sure until after name resolution (`N` could refer to a free
  const or a nullary struct). If it has no chance as being a const
  param, then we create a `DefId` in `DefCollector` -- otherwise we
  decide during ast_lowering. This will have to be updated once all path
  consts use `ConstArgKind::Path`.

- We explicitly use `ConstArgHasType` for array lengths, rather than
  implicitly relying on anon const type feeding -- this is due to the
  addition of `ConstArgKind::Path`.

- Some tests have their outputs changed, but the changes are for the
  most part minor (including removing duplicate or almost-duplicate
  errors). One test now ICEs, but it is for an incomplete, unstable
  feature and is now tracked at rust-lang#127009.
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 18, 2024
Represent type-level consts with new-and-improved `hir::ConstArg`

### Summary

This is a step toward `min_generic_const_exprs`. We now represent all const
generic arguments using an enum that differentiates between const *paths*
(temporarily just bare const params) and arbitrary anon consts that may perform
computations. This will enable us to cleanly implement the `min_generic_const_args`
plan of allowing the use of generics in paths used as const args, while
disallowing their use in arbitrary anon consts. Here is a summary of the salient
aspects of this change:

- Add `current_def_id_parent` to `LoweringContext`

  This is needed to track anon const parents properly once we implement
  `ConstArgKind::Path` (which requires moving anon const def-creation
  outside of `DefCollector`).

- Create `hir::ConstArgKind` enum with `Path` and `Anon` variants. Use it in the
  existing `hir::ConstArg` struct, replacing the previous `hir::AnonConst` field.

- Use `ConstArg` for all instances of const args. Specifically, use it instead
  of `AnonConst` for assoc item constraints, array lengths, and const param
  defaults.

- Some `ast::AnonConst`s now have their `DefId`s created in
  rustc_ast_lowering rather than `DefCollector`. This is because in some
  cases they will end up becoming a `ConstArgKind::Path` instead, which
  has no `DefId`. We have to solve this in a hacky way where we guess
  whether the `AnonConst` could end up as a path const since we can't
  know for sure until after name resolution (`N` could refer to a free
  const or a nullary struct). If it has no chance as being a const
  param, then we create a `DefId` in `DefCollector` -- otherwise we
  decide during ast_lowering. This will have to be updated once all path
  consts use `ConstArgKind::Path`.

- We explicitly use `ConstArgHasType` for array lengths, rather than
  implicitly relying on anon const type feeding -- this is due to the
  addition of `ConstArgKind::Path`.

- Some tests have their outputs changed, but the changes are for the
  most part minor (including removing duplicate or almost-duplicate
  errors). One test now ICEs, but it is for an incomplete, unstable
  feature and is now tracked at rust-lang#127009.

### Followup items post-merge

- Use `ConstArgKind::Path` for all const paths, not just const params.
- Fix rust-lang#127009
- If a path in generic args doesn't resolve as a type, try to resolve as a const
  instead (do this in rustc_resolve). Then remove the special-casing from
  `rustc_ast_lowering`, so that all params will automatically be lowered as
  `ConstArgKind::Path`.
- (?) Consider making `const_evaluatable_unchecked` a hard error, or at least
  trying it in crater

r? `@BoxyUwU`
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 18, 2024
Represent type-level consts with new-and-improved `hir::ConstArg`

### Summary

This is a step toward `min_generic_const_exprs`. We now represent all const
generic arguments using an enum that differentiates between const *paths*
(temporarily just bare const params) and arbitrary anon consts that may perform
computations. This will enable us to cleanly implement the `min_generic_const_args`
plan of allowing the use of generics in paths used as const args, while
disallowing their use in arbitrary anon consts. Here is a summary of the salient
aspects of this change:

- Add `current_def_id_parent` to `LoweringContext`

  This is needed to track anon const parents properly once we implement
  `ConstArgKind::Path` (which requires moving anon const def-creation
  outside of `DefCollector`).

- Create `hir::ConstArgKind` enum with `Path` and `Anon` variants. Use it in the
  existing `hir::ConstArg` struct, replacing the previous `hir::AnonConst` field.

- Use `ConstArg` for all instances of const args. Specifically, use it instead
  of `AnonConst` for assoc item constraints, array lengths, and const param
  defaults.

- Some `ast::AnonConst`s now have their `DefId`s created in
  rustc_ast_lowering rather than `DefCollector`. This is because in some
  cases they will end up becoming a `ConstArgKind::Path` instead, which
  has no `DefId`. We have to solve this in a hacky way where we guess
  whether the `AnonConst` could end up as a path const since we can't
  know for sure until after name resolution (`N` could refer to a free
  const or a nullary struct). If it has no chance as being a const
  param, then we create a `DefId` in `DefCollector` -- otherwise we
  decide during ast_lowering. This will have to be updated once all path
  consts use `ConstArgKind::Path`.

- We explicitly use `ConstArgHasType` for array lengths, rather than
  implicitly relying on anon const type feeding -- this is due to the
  addition of `ConstArgKind::Path`.

- Some tests have their outputs changed, but the changes are for the
  most part minor (including removing duplicate or almost-duplicate
  errors). One test now ICEs, but it is for an incomplete, unstable
  feature and is now tracked at rust-lang#127009.

### Followup items post-merge

- Use `ConstArgKind::Path` for all const paths, not just const params.
- Fix rust-lang#127009
- If a path in generic args doesn't resolve as a type, try to resolve as a const
  instead (do this in rustc_resolve). Then remove the special-casing from
  `rustc_ast_lowering`, so that all params will automatically be lowered as
  `ConstArgKind::Path`.
- (?) Consider making `const_evaluatable_unchecked` a hard error, or at least
  trying it in crater

r? `@BoxyUwU`
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 19, 2024
Represent type-level consts with new-and-improved `hir::ConstArg`

### Summary

This is a step toward `min_generic_const_exprs`. We now represent all const
generic arguments using an enum that differentiates between const *paths*
(temporarily just bare const params) and arbitrary anon consts that may perform
computations. This will enable us to cleanly implement the `min_generic_const_args`
plan of allowing the use of generics in paths used as const args, while
disallowing their use in arbitrary anon consts. Here is a summary of the salient
aspects of this change:

- Add `current_def_id_parent` to `LoweringContext`

  This is needed to track anon const parents properly once we implement
  `ConstArgKind::Path` (which requires moving anon const def-creation
  outside of `DefCollector`).

- Create `hir::ConstArgKind` enum with `Path` and `Anon` variants. Use it in the
  existing `hir::ConstArg` struct, replacing the previous `hir::AnonConst` field.

- Use `ConstArg` for all instances of const args. Specifically, use it instead
  of `AnonConst` for assoc item constraints, array lengths, and const param
  defaults.

- Some `ast::AnonConst`s now have their `DefId`s created in
  rustc_ast_lowering rather than `DefCollector`. This is because in some
  cases they will end up becoming a `ConstArgKind::Path` instead, which
  has no `DefId`. We have to solve this in a hacky way where we guess
  whether the `AnonConst` could end up as a path const since we can't
  know for sure until after name resolution (`N` could refer to a free
  const or a nullary struct). If it has no chance as being a const
  param, then we create a `DefId` in `DefCollector` -- otherwise we
  decide during ast_lowering. This will have to be updated once all path
  consts use `ConstArgKind::Path`.

- We explicitly use `ConstArgHasType` for array lengths, rather than
  implicitly relying on anon const type feeding -- this is due to the
  addition of `ConstArgKind::Path`.

- Some tests have their outputs changed, but the changes are for the
  most part minor (including removing duplicate or almost-duplicate
  errors). One test now ICEs, but it is for an incomplete, unstable
  feature and is now tracked at rust-lang#127009.

### Followup items post-merge

- Use `ConstArgKind::Path` for all const paths, not just const params.
- Fix (no github dont close this issue) rust-lang#127009
- If a path in generic args doesn't resolve as a type, try to resolve as a const
  instead (do this in rustc_resolve). Then remove the special-casing from
  `rustc_ast_lowering`, so that all params will automatically be lowered as
  `ConstArgKind::Path`.
- (?) Consider making `const_evaluatable_unchecked` a hard error, or at least
  trying it in crater

r? `@BoxyUwU`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 21, 2024
…xyUwU

Just totally fully deny late-bound consts

Kinda don't care about supporting this until we have where clauses on binders. They're super busted and should be reworked in due time, and they are approximately 100% useless until then 😸

Fixes rust-lang#127970
Fixes rust-lang#127009

r? `@BoxyUwU`
@bors bors closed this as completed in 2ef7699 Jul 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jul 22, 2024
Rollup merge of rust-lang#128020 - compiler-errors:nlb-no-const, r=BoxyUwU

Just totally fully deny late-bound consts

Kinda don't care about supporting this until we have where clauses on binders. They're super busted and should be reworked in due time, and they are approximately 100% useless until then 😸

Fixes rust-lang#127970
Fixes rust-lang#127009

r? ``@BoxyUwU``
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue Jul 25, 2024
Represent type-level consts with new-and-improved `hir::ConstArg`

### Summary

This is a step toward `min_generic_const_exprs`. We now represent all const
generic arguments using an enum that differentiates between const *paths*
(temporarily just bare const params) and arbitrary anon consts that may perform
computations. This will enable us to cleanly implement the `min_generic_const_args`
plan of allowing the use of generics in paths used as const args, while
disallowing their use in arbitrary anon consts. Here is a summary of the salient
aspects of this change:

- Add `current_def_id_parent` to `LoweringContext`

  This is needed to track anon const parents properly once we implement
  `ConstArgKind::Path` (which requires moving anon const def-creation
  outside of `DefCollector`).

- Create `hir::ConstArgKind` enum with `Path` and `Anon` variants. Use it in the
  existing `hir::ConstArg` struct, replacing the previous `hir::AnonConst` field.

- Use `ConstArg` for all instances of const args. Specifically, use it instead
  of `AnonConst` for assoc item constraints, array lengths, and const param
  defaults.

- Some `ast::AnonConst`s now have their `DefId`s created in
  rustc_ast_lowering rather than `DefCollector`. This is because in some
  cases they will end up becoming a `ConstArgKind::Path` instead, which
  has no `DefId`. We have to solve this in a hacky way where we guess
  whether the `AnonConst` could end up as a path const since we can't
  know for sure until after name resolution (`N` could refer to a free
  const or a nullary struct). If it has no chance as being a const
  param, then we create a `DefId` in `DefCollector` -- otherwise we
  decide during ast_lowering. This will have to be updated once all path
  consts use `ConstArgKind::Path`.

- We explicitly use `ConstArgHasType` for array lengths, rather than
  implicitly relying on anon const type feeding -- this is due to the
  addition of `ConstArgKind::Path`.

- Some tests have their outputs changed, but the changes are for the
  most part minor (including removing duplicate or almost-duplicate
  errors). One test now ICEs, but it is for an incomplete, unstable
  feature and is now tracked at rust-lang/rust#127009.

### Followup items post-merge

- Use `ConstArgKind::Path` for all const paths, not just const params.
- Fix (no github dont close this issue) #127009
- If a path in generic args doesn't resolve as a type, try to resolve as a const
  instead (do this in rustc_resolve). Then remove the special-casing from
  `rustc_ast_lowering`, so that all params will automatically be lowered as
  `ConstArgKind::Path`.
- (?) Consider making `const_evaluatable_unchecked` a hard error, or at least
  trying it in crater

r? `@BoxyUwU`
flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 25, 2024
This is a very large commit since a lot needs to be changed in order to
make the tests pass. The salient changes are:

- `ConstArgKind` gets a new `Path` variant, and all const params are now
  represented using it. Non-param paths still use `ConstArgKind::Anon`
  to prevent this change from getting too large, but they will soon use
  the `Path` variant too.

- `ConstArg` gets a distinct `hir_id` field and its own variant in
  `hir::Node`. This affected many parts of the compiler that expected
  the parent of an `AnonConst` to be the containing context (e.g., an
  array repeat expression). They have been changed to check the
  "grandparent" where necessary.

- Some `ast::AnonConst`s now have their `DefId`s created in
  rustc_ast_lowering rather than `DefCollector`. This is because in some
  cases they will end up becoming a `ConstArgKind::Path` instead, which
  has no `DefId`. We have to solve this in a hacky way where we guess
  whether the `AnonConst` could end up as a path const since we can't
  know for sure until after name resolution (`N` could refer to a free
  const or a nullary struct). If it has no chance as being a const
  param, then we create a `DefId` in `DefCollector` -- otherwise we
  decide during ast_lowering. This will have to be updated once all path
  consts use `ConstArgKind::Path`.

- We explicitly use `ConstArgHasType` for array lengths, rather than
  implicitly relying on anon const type feeding -- this is due to the
  addition of `ConstArgKind::Path`.

- Some tests have their outputs changed, but the changes are for the
  most part minor (including removing duplicate or almost-duplicate
  errors). One test now ICEs, but it is for an incomplete, unstable
  feature and is now tracked at rust-lang#127009.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-non_lifetime_binders `#![feature(non_lifetime_binders)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features This issue requires the use of incomplete features. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants