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: unexpected const !2: usize #121052

Open
matthiaskrgr opened this issue Feb 13, 2024 · 3 comments
Open

ICE: unexpected const !2: usize #121052

matthiaskrgr opened this issue Feb 13, 2024 · 3 comments
Labels
C-bug Category: This is a bug. F-generic_const_exprs `#![feature(generic_const_exprs)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

snippet:

#![feature(generic_const_exprs, with_negative_coherence)]

use std::ops::Mul;

pub trait Indices<const N: usize> {
    const NUM_ELEMS: usize;
}

impl<I: Indices<N>, J: Indices<N>, const N: usize> Mul for Tensor<I, N>
where
    I: Concat<J>,
    <I as Concat<J>>::Output: Indices<N>,
    [u8; I::NUM_ELEMS]: Sized,
    [u8; J::NUM_ELEMS]: Sized,
    [u8; <I as Concat<J>>::Output::NUM_ELEMS]: Sized,
{
}

pub trait Concat<J> {}

pub struct Tensor<I: Indices<N>, const N: usize> {}

impl<I: Indices<N>, J: Indices<N>, const N: usize> Mul for Tensor<I, N>
where
    I: Concat<J>,
    <I as Concat<J>>::Output: Indices<N>,
    [u8; I::NUM_ELEMS]: Sized,
    [u8; J::NUM_ELEMS]: Sized,
    [u8; <I as Concat<J>>::Output::NUM_ELEMS]: Sized,
{
}

Version information

rustc 1.78.0-nightly (a84bb95a1 2024-02-13)
binary: rustc
commit-hash: a84bb95a1f65bfe25038f188763a18e096a86ab2
commit-date: 2024-02-13
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0576]: cannot find associated type `Output` in trait `Concat`
  --> /tmp/icemaker_global_tempdir.JmhHu65RE3t8/rustc_testrunner_tmpdir_reporting.SAuTnLQ72a4e/mvce.rs:12:23
   |
12 |     <I as Concat<J>>::Output: Indices<N>,
   |                       ^^^^^^ not found in `Concat`

error[E0576]: cannot find associated type `Output` in trait `Concat`
  --> /tmp/icemaker_global_tempdir.JmhHu65RE3t8/rustc_testrunner_tmpdir_reporting.SAuTnLQ72a4e/mvce.rs:15:28
   |
15 |     [u8; <I as Concat<J>>::Output::NUM_ELEMS]: Sized,
   |                            ^^^^^^ not found in `Concat`

error[E0576]: cannot find associated type `Output` in trait `Concat`
  --> /tmp/icemaker_global_tempdir.JmhHu65RE3t8/rustc_testrunner_tmpdir_reporting.SAuTnLQ72a4e/mvce.rs:26:23
   |
26 |     <I as Concat<J>>::Output: Indices<N>,
   |                       ^^^^^^ not found in `Concat`

error[E0576]: cannot find associated type `Output` in trait `Concat`
  --> /tmp/icemaker_global_tempdir.JmhHu65RE3t8/rustc_testrunner_tmpdir_reporting.SAuTnLQ72a4e/mvce.rs:29:28
   |
29 |     [u8; <I as Concat<J>>::Output::NUM_ELEMS]: Sized,
   |                            ^^^^^^ not found in `Concat`

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

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

error[E0207]: the type parameter `J` is not constrained by the impl trait, self type, or predicates
 --> /tmp/icemaker_global_tempdir.JmhHu65RE3t8/rustc_testrunner_tmpdir_reporting.SAuTnLQ72a4e/mvce.rs:9:21
  |
9 | impl<I: Indices<N>, J: Indices<N>, const N: usize> Mul for Tensor<I, N>
  |                     ^ unconstrained type parameter

error[E0207]: the type parameter `J` is not constrained by the impl trait, self type, or predicates
  --> /tmp/icemaker_global_tempdir.JmhHu65RE3t8/rustc_testrunner_tmpdir_reporting.SAuTnLQ72a4e/mvce.rs:23:21
   |
23 | impl<I: Indices<N>, J: Indices<N>, const N: usize> Mul for Tensor<I, N>
   |                     ^ unconstrained type parameter

error: internal compiler error: compiler/rustc_infer/src/infer/freshen.rs:176:17: unexpected const !2: usize

thread 'rustc' panicked at compiler/rustc_middle/src/util/bug.rs:35:44:
Box<dyn Any>
stack backtrace:
   0:     0x7f8228f8d086 - std::backtrace_rs::backtrace::libunwind::trace::h350c9bbd0d629e5a
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f8228f8d086 - std::backtrace_rs::backtrace::trace_unsynchronized::hb5ce80cf0732c5cf
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f8228f8d086 - std::sys_common::backtrace::_print_fmt::he116d0f55fe00810
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f8228f8d086 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h71fa05f97c99f332
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f8228fdd51c - core::fmt::rt::Argument::fmt::hfafe0bdb999ad9e2
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/core/src/fmt/rt.rs:142:9
   5:     0x7f8228fdd51c - core::fmt::write::h6115470fc2d68b0c
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f8228f80abf - std::io::Write::write_fmt::hdc66f4e88b29f74f
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/std/src/io/mod.rs:1854:15
   7:     0x7f8228f8ce34 - std::sys_common::backtrace::_print::hcb29a46764838669
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f8228f8ce34 - std::sys_common::backtrace::print::h05e4e1c5c9b1d560
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f8228f8fb7b - std::panicking::default_hook::{{closure}}::h8d5ead34896ab42d
  10:     0x7f8228f8f8c9 - std::panicking::default_hook::h78047fe2f192a868
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/std/src/panicking.rs:292:9
  11:     0x7f822bd463bc - std[466eff1cc2ed908f]::panicking::update_hook::<alloc[4ead1f6995f5264c]::boxed::Box<rustc_driver_impl[c431125988ed1f11]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f8228f902e0 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hcfe839bef410f29b
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/alloc/src/boxed.rs:2030:9
  13:     0x7f8228f902e0 - std::panicking::rust_panic_with_hook::h1e5f7f410afd2444
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/std/src/panicking.rs:785:13
  14:     0x7f822bd73d24 - std[466eff1cc2ed908f]::panicking::begin_panic::<rustc_errors[1de830c8c65656ce]::ExplicitBug>::{closure#0}
  15:     0x7f822bd70c36 - std[466eff1cc2ed908f]::sys_common::backtrace::__rust_end_short_backtrace::<std[466eff1cc2ed908f]::panicking::begin_panic<rustc_errors[1de830c8c65656ce]::ExplicitBug>::{closure#0}, !>
  16:     0x7f822bd70636 - std[466eff1cc2ed908f]::panicking::begin_panic::<rustc_errors[1de830c8c65656ce]::ExplicitBug>
  17:     0x7f822bd7f671 - <rustc_errors[1de830c8c65656ce]::diagnostic_builder::BugAbort as rustc_errors[1de830c8c65656ce]::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
  18:     0x7f822c138b6e - <rustc_errors[1de830c8c65656ce]::DiagCtxt>::bug::<alloc[4ead1f6995f5264c]::string::String>
  19:     0x7f822c1d265b - rustc_middle[80ff7a15503a7fbe]::util::bug::opt_span_bug_fmt::<rustc_span[f008fc136599d052]::span_encoding::Span>::{closure#0}
  20:     0x7f822c1b9ffa - rustc_middle[80ff7a15503a7fbe]::ty::context::tls::with_opt::<rustc_middle[80ff7a15503a7fbe]::util::bug::opt_span_bug_fmt<rustc_span[f008fc136599d052]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f822c1b9e98 - rustc_middle[80ff7a15503a7fbe]::ty::context::tls::with_context_opt::<rustc_middle[80ff7a15503a7fbe]::ty::context::tls::with_opt<rustc_middle[80ff7a15503a7fbe]::util::bug::opt_span_bug_fmt<rustc_span[f008fc136599d052]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f822a6a9470 - rustc_middle[80ff7a15503a7fbe]::util::bug::bug_fmt
  23:     0x7f822d3dd2af - <rustc_infer[fc90b6d353db46a7]::infer::freshen::TypeFreshener as rustc_type_ir[ebc5bf0fdfdb0d04]::fold::TypeFolder<rustc_middle[80ff7a15503a7fbe]::ty::context::TyCtxt>>::fold_const
  24:     0x7f822a693797 - <rustc_trait_selection[4b445828abf7ba1d]::traits::select::SelectionContext>::poly_select
  25:     0x7f822d29381f - rustc_traits[ab147ed71eb77be]::codegen::codegen_select_candidate
  26:     0x7f822d2932ef - rustc_query_impl[56a5a1cad20ac6aa]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[56a5a1cad20ac6aa]::query_impl::codegen_select_candidate::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 16usize]>>
  27:     0x7f822d292824 - rustc_query_system[790ca29724b87fee]::query::plumbing::try_execute_query::<rustc_query_impl[56a5a1cad20ac6aa]::DynamicConfig<rustc_query_system[790ca29724b87fee]::query::caches::DefaultCache<(rustc_middle[80ff7a15503a7fbe]::ty::ParamEnv, rustc_middle[80ff7a15503a7fbe]::ty::predicate::TraitRef), rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[56a5a1cad20ac6aa]::plumbing::QueryCtxt, false>
  28:     0x7f822d2924dd - rustc_query_impl[56a5a1cad20ac6aa]::query_impl::codegen_select_candidate::get_query_non_incr::__rust_end_short_backtrace
  29:     0x7f822aa2daf7 - rustc_ty_utils[1f3d0eb1fe395dcd]::instance::resolve_instance
  30:     0x7f822d24acc5 - rustc_query_impl[56a5a1cad20ac6aa]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[56a5a1cad20ac6aa]::query_impl::resolve_instance::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 32usize]>>
  31:     0x7f822d24b004 - rustc_query_system[790ca29724b87fee]::query::plumbing::try_execute_query::<rustc_query_impl[56a5a1cad20ac6aa]::DynamicConfig<rustc_query_system[790ca29724b87fee]::query::caches::DefaultCache<rustc_middle[80ff7a15503a7fbe]::ty::ParamEnvAnd<(rustc_span[f008fc136599d052]::def_id::DefId, &rustc_middle[80ff7a15503a7fbe]::ty::list::List<rustc_middle[80ff7a15503a7fbe]::ty::generic_args::GenericArg>)>, rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 32usize]>>, false, false, false>, rustc_query_impl[56a5a1cad20ac6aa]::plumbing::QueryCtxt, false>
  32:     0x7f822d24ac5d - rustc_query_impl[56a5a1cad20ac6aa]::query_impl::resolve_instance::get_query_non_incr::__rust_end_short_backtrace
  33:     0x7f822b223c71 - <rustc_middle[80ff7a15503a7fbe]::ty::context::TyCtxt>::const_eval_resolve
  34:     0x7f822de55553 - rustc_const_eval[b73c79410a5da8b8]::const_eval::eval_queries::eval_body_using_ecx::{closure#0}
  35:     0x7f822de52870 - rustc_const_eval[b73c79410a5da8b8]::const_eval::eval_queries::eval_in_interpreter
  36:     0x7f822d55771a - rustc_const_eval[b73c79410a5da8b8]::const_eval::eval_queries::eval_to_allocation_raw_provider
  37:     0x7f822d557576 - rustc_query_impl[56a5a1cad20ac6aa]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[56a5a1cad20ac6aa]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 24usize]>>
  38:     0x7f822d8b2451 - rustc_query_system[790ca29724b87fee]::query::plumbing::try_execute_query::<rustc_query_impl[56a5a1cad20ac6aa]::DynamicConfig<rustc_query_system[790ca29724b87fee]::query::caches::DefaultCache<rustc_middle[80ff7a15503a7fbe]::ty::ParamEnvAnd<rustc_middle[80ff7a15503a7fbe]::mir::interpret::GlobalId>, rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[56a5a1cad20ac6aa]::plumbing::QueryCtxt, false>
  39:     0x7f822d8b202c - rustc_query_impl[56a5a1cad20ac6aa]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  40:     0x7f822dd1e114 - rustc_const_eval[b73c79410a5da8b8]::const_eval::valtrees::eval_to_valtree
  41:     0x7f822dd1df30 - <rustc_const_eval[b73c79410a5da8b8]::provide::{closure#0} as core[16c6da236be526b4]::ops::function::FnOnce<(rustc_middle[80ff7a15503a7fbe]::ty::context::TyCtxt, rustc_middle[80ff7a15503a7fbe]::ty::ParamEnvAnd<rustc_middle[80ff7a15503a7fbe]::mir::interpret::GlobalId>)>>::call_once
  42:     0x7f822dd1df04 - rustc_query_impl[56a5a1cad20ac6aa]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[56a5a1cad20ac6aa]::query_impl::eval_to_valtree::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 24usize]>>
  43:     0x7f822dd1dec5 - <rustc_query_impl[56a5a1cad20ac6aa]::query_impl::eval_to_valtree::dynamic_query::{closure#2} as core[16c6da236be526b4]::ops::function::FnOnce<(rustc_middle[80ff7a15503a7fbe]::ty::context::TyCtxt, rustc_middle[80ff7a15503a7fbe]::ty::ParamEnvAnd<rustc_middle[80ff7a15503a7fbe]::mir::interpret::GlobalId>)>>::call_once
  44:     0x7f822d8b252c - rustc_query_system[790ca29724b87fee]::query::plumbing::try_execute_query::<rustc_query_impl[56a5a1cad20ac6aa]::DynamicConfig<rustc_query_system[790ca29724b87fee]::query::caches::DefaultCache<rustc_middle[80ff7a15503a7fbe]::ty::ParamEnvAnd<rustc_middle[80ff7a15503a7fbe]::mir::interpret::GlobalId>, rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[56a5a1cad20ac6aa]::plumbing::QueryCtxt, false>
  45:     0x7f822d8b1e2c - rustc_query_impl[56a5a1cad20ac6aa]::query_impl::eval_to_valtree::get_query_non_incr::__rust_end_short_backtrace
  46:     0x7f822d9abeee - rustc_middle[80ff7a15503a7fbe]::query::plumbing::query_get_at::<rustc_query_system[790ca29724b87fee]::query::caches::DefaultCache<rustc_middle[80ff7a15503a7fbe]::ty::ParamEnvAnd<rustc_middle[80ff7a15503a7fbe]::mir::interpret::GlobalId>, rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 24usize]>>>
  47:     0x7f822d9abb19 - <rustc_middle[80ff7a15503a7fbe]::ty::context::TyCtxt>::const_eval_global_id_for_typeck
  48:     0x7f822d9ab39e - <rustc_middle[80ff7a15503a7fbe]::ty::context::TyCtxt>::const_eval_resolve_for_typeck
  49:     0x7f822c02d826 - <rustc_infer[fc90b6d353db46a7]::infer::InferCtxt>::const_eval_resolve
  50:     0x7f822c00fafa - <rustc_infer[fc90b6d353db46a7]::infer::InferCtxt>::try_const_eval_resolve
  51:     0x7f822c7c37a5 - <rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::try_const_eval_resolve
  52:     0x7f822c7d1278 - <rustc_trait_selection[4b445828abf7ba1d]::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
  53:     0x7f822c7ce013 - <rustc_trait_selection[4b445828abf7ba1d]::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
  54:     0x7f822c7c2478 - <rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::evaluate_goal
  55:     0x7f822c83379f - <rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::try_evaluate_added_goals
  56:     0x7f822c830c8d - <rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::try_normalize_term
  57:     0x7f822c7d1d65 - <rustc_trait_selection[4b445828abf7ba1d]::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
  58:     0x7f822c7ce013 - <rustc_trait_selection[4b445828abf7ba1d]::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
  59:     0x7f822c7c2478 - <rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::evaluate_goal
  60:     0x7f822c83379f - <rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::try_evaluate_added_goals
  61:     0x7f822c8310f1 - <rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::evaluate_added_goals_and_make_canonical_response
  62:     0x7f822c7d5d21 - <rustc_middle[80ff7a15503a7fbe]::ty::predicate::TraitPredicate as rustc_trait_selection[4b445828abf7ba1d]::solve::assembly::GoalKind>::probe_and_match_goal_against_assumption::<<rustc_middle[80ff7a15503a7fbe]::ty::predicate::TraitPredicate as rustc_trait_selection[4b445828abf7ba1d]::solve::assembly::GoalKind>::consider_implied_clause<[rustc_middle[80ff7a15503a7fbe]::traits::solve::Goal<rustc_middle[80ff7a15503a7fbe]::ty::predicate::Predicate>; 0usize]>::{closure#0}>
  63:     0x7f822c830d18 - <rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::assemble_param_env_candidates::<rustc_middle[80ff7a15503a7fbe]::ty::predicate::TraitPredicate>
  64:     0x7f822c7b9055 - <rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::assemble_and_evaluate_candidates::<rustc_middle[80ff7a15503a7fbe]::ty::predicate::TraitPredicate>
  65:     0x7f822c7d197b - <rustc_trait_selection[4b445828abf7ba1d]::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
  66:     0x7f822c7ce013 - <rustc_trait_selection[4b445828abf7ba1d]::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
  67:     0x7f822c7c2478 - <rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::evaluate_goal
  68:     0x7f822c7c1e6c - <rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::EvalCtxt>::enter_root::<core[16c6da236be526b4]::result::Result<(bool, rustc_middle[80ff7a15503a7fbe]::traits::solve::Certainty, alloc[4ead1f6995f5264c]::vec::Vec<rustc_middle[80ff7a15503a7fbe]::traits::solve::Goal<rustc_middle[80ff7a15503a7fbe]::ty::predicate::Predicate>>), rustc_middle[80ff7a15503a7fbe]::traits::query::NoSolution>, <rustc_infer[fc90b6d353db46a7]::infer::InferCtxt as rustc_trait_selection[4b445828abf7ba1d]::solve::eval_ctxt::InferCtxtEvalExt>::evaluate_root_goal::{closure#0}>
  69:     0x7f822c7c3ff3 - <rustc_trait_selection[4b445828abf7ba1d]::solve::fulfill::FulfillmentCtxt as rustc_infer[fc90b6d353db46a7]::traits::engine::TraitEngine>::select_where_possible
  70:     0x7f822d2911a5 - <rustc_trait_selection[4b445828abf7ba1d]::traits::engine::ObligationCtxt>::select_all_or_error
  71:     0x7f822c7e0837 - rustc_trait_selection[4b445828abf7ba1d]::traits::coherence::impl_intersection_has_negative_obligation
  72:     0x7f822d2406a6 - rustc_trait_selection[4b445828abf7ba1d]::traits::coherence::overlap
  73:     0x7f822da3d42b - <rustc_middle[80ff7a15503a7fbe]::traits::specialization_graph::Children as rustc_trait_selection[4b445828abf7ba1d]::traits::specialize::specialization_graph::ChildrenExt>::insert
  74:     0x7f822da3c991 - <rustc_middle[80ff7a15503a7fbe]::traits::specialization_graph::Graph as rustc_trait_selection[4b445828abf7ba1d]::traits::specialize::specialization_graph::GraphExt>::insert
  75:     0x7f822da3fb77 - rustc_trait_selection[4b445828abf7ba1d]::traits::specialize::specialization_graph_provider
  76:     0x7f822da3f60d - rustc_query_impl[56a5a1cad20ac6aa]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[56a5a1cad20ac6aa]::query_impl::specialization_graph_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 8usize]>>
  77:     0x7f822d0827a0 - rustc_query_system[790ca29724b87fee]::query::plumbing::try_execute_query::<rustc_query_impl[56a5a1cad20ac6aa]::DynamicConfig<rustc_query_system[790ca29724b87fee]::query::caches::DefIdCache<rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[56a5a1cad20ac6aa]::plumbing::QueryCtxt, false>
  78:     0x7f822d583f9e - rustc_query_impl[56a5a1cad20ac6aa]::query_impl::specialization_graph_of::get_query_non_incr::__rust_end_short_backtrace
  79:     0x7f822d58438d - rustc_hir_analysis[46d1d11b50942035]::coherence::coherent_trait
  80:     0x7f822d584135 - rustc_query_impl[56a5a1cad20ac6aa]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[56a5a1cad20ac6aa]::query_impl::coherent_trait::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 1usize]>>
  81:     0x7f822d0f2a16 - rustc_query_system[790ca29724b87fee]::query::plumbing::try_execute_query::<rustc_query_impl[56a5a1cad20ac6aa]::DynamicConfig<rustc_query_system[790ca29724b87fee]::query::caches::DefIdCache<rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[56a5a1cad20ac6aa]::plumbing::QueryCtxt, false>
  82:     0x7f822d615e55 - rustc_query_impl[56a5a1cad20ac6aa]::query_impl::coherent_trait::get_query_non_incr::__rust_end_short_backtrace
  83:     0x7f822d1c8396 - rustc_hir_analysis[46d1d11b50942035]::check_crate
  84:     0x7f822d9e8c13 - rustc_interface[b495b14b2a666c1a]::passes::analysis
  85:     0x7f822d9e8869 - rustc_query_impl[56a5a1cad20ac6aa]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[56a5a1cad20ac6aa]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 1usize]>>
  86:     0x7f822daaf3a5 - rustc_query_system[790ca29724b87fee]::query::plumbing::try_execute_query::<rustc_query_impl[56a5a1cad20ac6aa]::DynamicConfig<rustc_query_system[790ca29724b87fee]::query::caches::SingleCache<rustc_middle[80ff7a15503a7fbe]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[56a5a1cad20ac6aa]::plumbing::QueryCtxt, false>
  87:     0x7f822daaf109 - rustc_query_impl[56a5a1cad20ac6aa]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  88:     0x7f822dcea77b - rustc_interface[b495b14b2a666c1a]::interface::run_compiler::<core[16c6da236be526b4]::result::Result<(), rustc_span[f008fc136599d052]::ErrorGuaranteed>, rustc_driver_impl[c431125988ed1f11]::run_compiler::{closure#0}>::{closure#0}
  89:     0x7f822df7e854 - std[466eff1cc2ed908f]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b495b14b2a666c1a]::util::run_in_thread_with_globals<rustc_interface[b495b14b2a666c1a]::util::run_in_thread_pool_with_globals<rustc_interface[b495b14b2a666c1a]::interface::run_compiler<core[16c6da236be526b4]::result::Result<(), rustc_span[f008fc136599d052]::ErrorGuaranteed>, rustc_driver_impl[c431125988ed1f11]::run_compiler::{closure#0}>::{closure#0}, core[16c6da236be526b4]::result::Result<(), rustc_span[f008fc136599d052]::ErrorGuaranteed>>::{closure#0}, core[16c6da236be526b4]::result::Result<(), rustc_span[f008fc136599d052]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[16c6da236be526b4]::result::Result<(), rustc_span[f008fc136599d052]::ErrorGuaranteed>>
  90:     0x7f822df7e680 - <<std[466eff1cc2ed908f]::thread::Builder>::spawn_unchecked_<rustc_interface[b495b14b2a666c1a]::util::run_in_thread_with_globals<rustc_interface[b495b14b2a666c1a]::util::run_in_thread_pool_with_globals<rustc_interface[b495b14b2a666c1a]::interface::run_compiler<core[16c6da236be526b4]::result::Result<(), rustc_span[f008fc136599d052]::ErrorGuaranteed>, rustc_driver_impl[c431125988ed1f11]::run_compiler::{closure#0}>::{closure#0}, core[16c6da236be526b4]::result::Result<(), rustc_span[f008fc136599d052]::ErrorGuaranteed>>::{closure#0}, core[16c6da236be526b4]::result::Result<(), rustc_span[f008fc136599d052]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[16c6da236be526b4]::result::Result<(), rustc_span[f008fc136599d052]::ErrorGuaranteed>>::{closure#1} as core[16c6da236be526b4]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  91:     0x7f8228f99425 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf2f3f78227db386b
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/alloc/src/boxed.rs:2016:9
  92:     0x7f8228f99425 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hfde7215efc7d46f6
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/alloc/src/boxed.rs:2016:9
  93:     0x7f8228f99425 - std::sys::pal::unix::thread::Thread::new::thread_start::hca4f71b4c325cea0
                               at /rustc/a84bb95a1f65bfe25038f188763a18e096a86ab2/library/std/src/sys/pal/unix/thread.rs:108:17
  94:     0x7f8228d819eb - <unknown>
  95:     0x7f8228e057cc - <unknown>
  96:                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.78.0-nightly (a84bb95a1 2024-02-13) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [codegen_select_candidate] computing candidate for `<!1 as Indices<!2>>`
#1 [resolve_instance] resolving instance `<!1 as Indices<!2>>::NUM_ELEMS`
#2 [eval_to_allocation_raw] const-evaluating + checking `<impl at /tmp/icemaker_global_tempdir.JmhHu65RE3t8/rustc_testrunner_tmpdir_reporting.SAuTnLQ72a4e/mvce.rs:9:1: 15:54>::{constant#1}`
#3 [eval_to_valtree] evaluating type-level constant
#4 [specialization_graph_of] building specialization graph of trait `core::ops::arith::Mul`
#5 [coherent_trait] coherence checking all impls of trait `core::ops::arith::Mul`
#6 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 8 previous errors; 1 warning emitted

Some errors have detailed explanations: E0207, E0576, E0601.
For more information about an error, try `rustc --explain E0207`.

@matthiaskrgr matthiaskrgr 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. F-generic_const_exprs `#![feature(generic_const_exprs)]` labels Feb 13, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 13, 2024
@matthiaskrgr
Copy link
Member Author

This bisects to #120836 cc @lcnr 🤔

@lcnr
Copy link
Contributor

lcnr commented Feb 13, 2024

the new solver ends up calling into the old one via const evaluation 😅 the old solver cannot handle placeholder consts 🤔 🤷

i think this can impact -Znext-solver=coherence by itself, cc @compiler-errors

@lcnr
Copy link
Contributor

lcnr commented Feb 13, 2024

though, given that it relies on gce this seems alright to delay until after the stabilization

@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 13, 2024
@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-generic_const_exprs `#![feature(generic_const_exprs)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants