Skip to content

Conflicting trait impls cause ICE with generic_const_exprs #119692

Description

@tehforsch

Code (Playground)

#![allow(incomplete_features)]
#![feature(adt_const_params)]
#![feature(generic_const_exprs)]

use std::ops::Add;

#[derive(PartialEq, Eq, Clone, Debug, core::marker::ConstParamTy)]
pub struct Dimension;

#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Default)]
pub struct Quantity<S, const D: Dimension>(pub(crate) S);

impl<const D: Dimension, LHS, RHS> Add<Quantity<RHS, D>> for Quantity<LHS, D>
where
    LHS: Add<RHS>,
{
    type Output = Quantity<<LHS as Add<RHS>>::Output, D>;
    fn add(self, rhs: Quantity<RHS, D>) -> Self::Output {
        Quantity(self.0 + rhs.0)
    }
}

impl<LHS, RHS> Add<RHS> for Quantity<LHS, { Dimension }>
where
    LHS: Add<RHS>,
{
    type Output = Quantity<<LHS as Add<RHS>>::Output, { Dimension }>;
    fn add(self, rhs: RHS) -> Self::Output {
        Quantity(self.0 + rhs)
    }
}

impl Add<Quantity<f32, { Dimension }>> for f32 {
    type Output = Quantity<f32, { Dimension }>;
    fn add(self, rhs: Quantity<f32, { Dimension }>) -> Self::Output {
        Quantity(self + rhs.0)
    }
}

pub fn add<const U: Dimension>(x: Quantity<f32, U>, y: Quantity<f32, U>) -> Quantity<f32, U> {
    x + y
}

fn main() {
    add(Quantity::<f32, {Dimension}>(1.0), Quantity(2.0));
}

The code should not compile, since the first two trait impls are conflicting. If generic_const_exprs is disabled (it is not needed code-wise in this reduced example, but was necessary in my original code), the compiler gives the correct error message:

error[E0119]: conflicting implementations of trait `Add<Quantity<_, Dimension>>` for type `Quantity<_, Dimension>`
  --> src/main.rs:22:1
   |
12 | / impl<const D: Dimension, LHS, RHS> Add<Quantity<RHS, D>> for Quantity<LHS, D>
13 | | where
14 | |     LHS: Add<RHS>,
   | |__________________- first implementation here
...
22 | / impl<LHS, RHS> Add<RHS> for Quantity<LHS, { Dimension }>
23 | | where
24 | |     LHS: Add<RHS>,
   | |__________________^ conflicting implementation for `Quantity<_, Dimension>`

Note that the even the third trait impl is needed in order to reproduce the ICE. The code compiles fine if either the second or the third trait impl is removed (the first one is actually used, so it cant be removed).

Meta

rustc --version --verbose:

rustc 1.77.0-nightly (d6d7a9386 2023-12-22)
binary: rustc
commit-hash: d6d7a93866f2ffcfb51828b8859bdad760b54ce0
commit-date: 2023-12-22
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6

Error output

error: internal compiler error: compiler/rustc_middle/src/ty/instance.rs:414:25: failed to resolve instance for <Quantity<f32, Dimension> as Add>::add: Err(
                                    ErrorGuaranteed(
                                        (),
                                    ),
                                )

thread 'rustc' panicked at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/compiler/rustc_errors/src/lib.rs:1122:30:
Box<dyn Any>
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: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
Backtrace

stack backtrace:
   0:     0x7f38a818b6f6 - std::backtrace_rs::backtrace::libunwind::trace::h4c39d39dfbe9783d
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f38a818b6f6 - std::backtrace_rs::backtrace::trace_unsynchronized::h4dc8ace54ae311e5
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f38a818b6f6 - std::sys_common::backtrace::_print_fmt::hb93bb30078f88f5e
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f38a818b6f6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc0a088b7e0825f6a
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f38a81ddf40 - core::fmt::rt::Argument::fmt::h3bf37701eb7e7bdb
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/core/src/fmt/rt.rs:142:9
   5:     0x7f38a81ddf40 - core::fmt::write::h7e6ab5f6daf5c422
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f38a817f4af - std::io::Write::write_fmt::h08c3306cb5bf723d
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/std/src/io/mod.rs:1810:15
   7:     0x7f38a818b4d4 - std::sys_common::backtrace::_print::hafed43d2fa285a46
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f38a818b4d4 - std::sys_common::backtrace::print::h39c23a58558ca2e2
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f38a818e267 - std::panicking::default_hook::{{closure}}::h33423deafbc8e615
  10:     0x7f38a818dfc9 - std::panicking::default_hook::h50ae27bf0009ee3b
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/std/src/panicking.rs:292:9
  11:     0x7f38aaf82ccc - std[3a009c5aa3cd6e18]::panicking::update_hook::<alloc[7046a3554d0212f6]::boxed::Box<rustc_driver_impl[99e8362fbaa298ef]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f38a818e9b6 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h5ddf83902817cab1
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/alloc/src/boxed.rs:2029:9
  13:     0x7f38a818e9b6 - std::panicking::rust_panic_with_hook::hbc586ac9df6b73a8
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/std/src/panicking.rs:783:13
  14:     0x7f38aafbbcd4 - std[3a009c5aa3cd6e18]::panicking::begin_panic::<rustc_errors[f488520a7868b61e]::ExplicitBug>::{closure#0}
  15:     0x7f38aafb8506 - std[3a009c5aa3cd6e18]::sys_common::backtrace::__rust_end_short_backtrace::<std[3a009c5aa3cd6e18]::panicking::begin_panic<rustc_errors[f488520a7868b61e]::ExplicitBug>::{closure#0}, !>
  16:     0x7f38aafb7eb6 - std[3a009c5aa3cd6e18]::panicking::begin_panic::<rustc_errors[f488520a7868b61e]::ExplicitBug>
  17:     0x7f38aafc6f01 - <rustc_errors[f488520a7868b61e]::diagnostic_builder::BugAbort as rustc_errors[f488520a7868b61e]::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
  18:     0x7f38ab39ee8f - <rustc_errors[f488520a7868b61e]::DiagCtxt>::bug::<alloc[7046a3554d0212f6]::string::String>
  19:     0x7f38ab43aa1b - rustc_middle[8402766bc0d86440]::util::bug::opt_span_bug_fmt::<rustc_span[fa12e73b1270738]::span_encoding::Span>::{closure#0}
  20:     0x7f38ab423d9a - rustc_middle[8402766bc0d86440]::ty::context::tls::with_opt::<rustc_middle[8402766bc0d86440]::util::bug::opt_span_bug_fmt<rustc_span[fa12e73b1270738]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f38ab423c38 - rustc_middle[8402766bc0d86440]::ty::context::tls::with_context_opt::<rustc_middle[8402766bc0d86440]::ty::context::tls::with_opt<rustc_middle[8402766bc0d86440]::util::bug::opt_span_bug_fmt<rustc_span[fa12e73b1270738]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f38a939e400 - rustc_middle[8402766bc0d86440]::util::bug::bug_fmt
  23:     0x7f38ac4778b8 - <rustc_middle[8402766bc0d86440]::ty::instance::Instance>::expect_resolve
  24:     0x7f38aa11a260 - rustc_monomorphize[87b7e1563872e463]::collector::collect_items_rec::{closure#0}
  25:     0x7f38ad116156 - rustc_monomorphize[87b7e1563872e463]::collector::collect_items_rec
  26:     0x7f38ad116654 - rustc_monomorphize[87b7e1563872e463]::collector::collect_items_rec
  27:     0x7f38ad111c3e - rustc_monomorphize[87b7e1563872e463]::partitioning::collect_and_partition_mono_items
  28:     0x7f38ad1111b0 - rustc_query_impl[a5b594d180e67741]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a5b594d180e67741]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8402766bc0d86440]::query::erase::Erased<[u8; 24usize]>>
  29:     0x7f38ad111195 - <rustc_query_impl[a5b594d180e67741]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2} as core[2b984803ee3f5e21]::ops::function::FnOnce<(rustc_middle[8402766bc0d86440]::ty::context::TyCtxt, ())>>::call_once
  30:     0x7f38ad10f9b7 - rustc_query_system[f0f2c4fcd6daa9a]::query::plumbing::try_execute_query::<rustc_query_impl[a5b594d180e67741]::DynamicConfig<rustc_query_system[f0f2c4fcd6daa9a]::query::caches::SingleCache<rustc_middle[8402766bc0d86440]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[a5b594d180e67741]::plumbing::QueryCtxt, true>
  31:     0x7f38ad2b5db3 - rustc_query_impl[a5b594d180e67741]::query_impl::collect_and_partition_mono_items::get_query_incr::__rust_end_short_backtrace
  32:     0x7f38acbab696 - rustc_codegen_ssa[daa1c997743eea6f]::base::codegen_crate::<rustc_codegen_llvm[e6316feb9c2ceeb]::LlvmCodegenBackend>
  33:     0x7f38acbab335 - <rustc_codegen_llvm[e6316feb9c2ceeb]::LlvmCodegenBackend as rustc_codegen_ssa[daa1c997743eea6f]::traits::backend::CodegenBackend>::codegen_crate
  34:     0x7f38acba95ed - rustc_interface[dfee6d40a3df20bb]::passes::start_codegen
  35:     0x7f38acba8d78 - <rustc_interface[dfee6d40a3df20bb]::queries::Queries>::codegen_and_build_linker
  36:     0x7f38ad19f2a8 - rustc_interface[dfee6d40a3df20bb]::interface::run_compiler::<core[2b984803ee3f5e21]::result::Result<(), rustc_span[fa12e73b1270738]::ErrorGuaranteed>, rustc_driver_impl[99e8362fbaa298ef]::run_compiler::{closure#0}>::{closure#0}
  37:     0x7f38ad125346 - std[3a009c5aa3cd6e18]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[dfee6d40a3df20bb]::util::run_in_thread_with_globals<rustc_interface[dfee6d40a3df20bb]::util::run_in_thread_pool_with_globals<rustc_interface[dfee6d40a3df20bb]::interface::run_compiler<core[2b984803ee3f5e21]::result::Result<(), rustc_span[fa12e73b1270738]::ErrorGuaranteed>, rustc_driver_impl[99e8362fbaa298ef]::run_compiler::{closure#0}>::{closure#0}, core[2b984803ee3f5e21]::result::Result<(), rustc_span[fa12e73b1270738]::ErrorGuaranteed>>::{closure#0}, core[2b984803ee3f5e21]::result::Result<(), rustc_span[fa12e73b1270738]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2b984803ee3f5e21]::result::Result<(), rustc_span[fa12e73b1270738]::ErrorGuaranteed>>
  38:     0x7f38ad125173 - <<std[3a009c5aa3cd6e18]::thread::Builder>::spawn_unchecked_<rustc_interface[dfee6d40a3df20bb]::util::run_in_thread_with_globals<rustc_interface[dfee6d40a3df20bb]::util::run_in_thread_pool_with_globals<rustc_interface[dfee6d40a3df20bb]::interface::run_compiler<core[2b984803ee3f5e21]::result::Result<(), rustc_span[fa12e73b1270738]::ErrorGuaranteed>, rustc_driver_impl[99e8362fbaa298ef]::run_compiler::{closure#0}>::{closure#0}, core[2b984803ee3f5e21]::result::Result<(), rustc_span[fa12e73b1270738]::ErrorGuaranteed>>::{closure#0}, core[2b984803ee3f5e21]::result::Result<(), rustc_span[fa12e73b1270738]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2b984803ee3f5e21]::result::Result<(), rustc_span[fa12e73b1270738]::ErrorGuaranteed>>::{closure#1} as core[2b984803ee3f5e21]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39:     0x7f38a81988e5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h446fa4c55b1bf8c4
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/alloc/src/boxed.rs:2015:9
  40:     0x7f38a81988e5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb661ed53115c5033
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/alloc/src/boxed.rs:2015:9
  41:     0x7f38a81988e5 - std::sys::unix::thread::Thread::new::thread_start::hbd74c47d36330101
                               at /rustc/d6d7a93866f2ffcfb51828b8859bdad760b54ce0/library/std/src/sys/unix/thread.rs:108:17
  42:     0x7f38a7f5a9eb - <unknown>
  43:     0x7f38a7fde7cc - <unknown>
  44:                0x0 - <unknown>

rustc-ice-2024-01-07T13_58_40-55799.txt

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jan 7, 2024
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 7, 2024
  3. matthiaskrgr commented on Jan 7, 2024

    @matthiaskrgr
    Member

    Bisects to #119148
    edit: oops, tested against the wrong code
    bisects to nightly-2023-05-18

    found 7 bors merge commits in the specified range
    commit[0] 2023-05-16: Auto merge of #111650 - matthiaskrgr:rollup-n7w17v4, r=matthiaskrgr
    commit[1] 2023-05-16: Auto merge of #111556 - cjgillot:copy-prop-nrvo, r=oli-obk
    commit[2] 2023-05-17: Auto merge of #111664 - weihanglo:update-cargo, r=weihanglo
    commit[3] 2023-05-17: Auto merge of #111630 - BoxyUwU:ty_const_debug_formatting, r=compiler-errors
    commit[4] 2023-05-17: Auto merge of #111671 - Dylan-DPC:rollup-1jy5r16, r=Dylan-DPC
    commit[5] 2023-05-17: Auto merge of #111680 - Dylan-DPC:rollup-1p45gxt, r=Dylan-DPC
    commit[6] 2023-05-17: Auto merge of #111568 - scottmcm:undo-opt, r=WaffleLapkin
    ERROR: no CI builds available between e77366b and e9e1bbc within last 167 days

  4. jieyouxu commented on Feb 14, 2024

    @jieyouxu
    Member

    @rustbot label +requires-incomplete-features +F-adt_const_params +F-generic_const_exprs +requires-nightly -needs-triage

  5. added
    requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 14, 2024
  6. added
    S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.
    on Apr 15, 2024
  7. workingjubilee commented on Jun 8, 2024

    @workingjubilee
    Member

    Much better minimization found by @pacak and @theemathas in #126078:

    #![feature(generic_const_exprs)]
    #![allow(incomplete_features)]
    
    trait Array {
        const SIZE: usize;
    }
    impl<const N: usize> Array for [i32; N] {
        const SIZE: usize = N;
    }
    
    // Note: Overlapping impls not detected by compiler
    trait Reflexive<T> {
        fn reflexive() {}
    }
    impl<T> Reflexive<T> for T {}
    impl<A: Array> Reflexive<[i32; A::SIZE]> for A {}
    
    fn do_reflexive<const N: usize>() {
        <[i32; N]>::reflexive();
    }
    // Note: Load-bearing `pub`. Removing the pub stops the ICE.
    pub fn what() {
        do_reflexive::<0>()
    }
    Compiler error
       Compiling playground v0.0.1 (/playground)
    error: internal compiler error: compiler/rustc_middle/src/ty/instance.rs:510:25: failed to resolve instance for <[i32; 0] as Reflexive<[i32; 0]>>::reflexive: Ok(
                                        None,
                                    )
    
    thread 'rustc' panicked at compiler/rustc_middle/src/ty/instance.rs:510:25:
    Box<dyn Any>
    stack backtrace:
       0:     0x7f5499f58f15 - std::backtrace_rs::backtrace::libunwind::trace::h7d3c800091db3e91
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
       1:     0x7f5499f58f15 - std::backtrace_rs::backtrace::trace_unsynchronized::h4cc0a280c32586b8
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
       2:     0x7f5499f58f15 - std::sys_common::backtrace::_print_fmt::h9005d7a683a6d7a4
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/std/src/sys_common/backtrace.rs:68:5
       3:     0x7f5499f58f15 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h519c17d5956798a6
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/std/src/sys_common/backtrace.rs:44:22
       4:     0x7f5499fa9c5b - core::fmt::rt::Argument::fmt::haa193bfc28a485eb
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/core/src/fmt/rt.rs:165:63
       5:     0x7f5499fa9c5b - core::fmt::write::h355a93f02c4b3ea1
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/core/src/fmt/mod.rs:1168:21
       6:     0x7f5499f4dc9f - std::io::Write::write_fmt::hbe0fd00858f9c1ec
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/std/src/io/mod.rs:1835:15
       7:     0x7f5499f58cee - std::sys_common::backtrace::_print::h7fe7f477e21fa361
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/std/src/sys_common/backtrace.rs:47:5
       8:     0x7f5499f58cee - std::sys_common::backtrace::print::h6c8dafcb53369ea1
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/std/src/sys_common/backtrace.rs:34:9
       9:     0x7f5499f5b729 - std::panicking::default_hook::{{closure}}::hbcbc771124e8a531
      10:     0x7f5499f5b4ca - std::panicking::default_hook::ha99c0605f25db782
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/std/src/panicking.rs:298:9
      11:     0x7f549d1a4a00 - std[59958118404e088f]::panicking::update_hook::<alloc[25fe46b0aaca8953]::boxed::Box<rustc_driver_impl[2627b6be84d2f0c]::install_ice_hook::{closure#0}>>::{closure#0}
      12:     0x7f5499f5be5b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h4e37e0de343f25a5
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/alloc/src/boxed.rs:2077:9
      13:     0x7f5499f5be5b - std::panicking::rust_panic_with_hook::h6b51162bdfe57bbe
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/std/src/panicking.rs:799:13
      14:     0x7f549d1d5224 - std[59958118404e088f]::panicking::begin_panic::<rustc_errors[2ff0989c1584c7c0]::ExplicitBug>::{closure#0}
      15:     0x7f549d1d1d06 - std[59958118404e088f]::sys_common::backtrace::__rust_end_short_backtrace::<std[59958118404e088f]::panicking::begin_panic<rustc_errors[2ff0989c1584c7c0]::ExplicitBug>::{closure#0}, !>
      16:     0x7f549d1cd116 - std[59958118404e088f]::panicking::begin_panic::<rustc_errors[2ff0989c1584c7c0]::ExplicitBug>
      17:     0x7f549d1de841 - <rustc_errors[2ff0989c1584c7c0]::diagnostic::BugAbort as rustc_errors[2ff0989c1584c7c0]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
      18:     0x7f549d6bb04c - rustc_middle[ce3fbd8192a3c5ff]::util::bug::opt_span_bug_fmt::<rustc_span[6bc65aeac19990f8]::span_encoding::Span>::{closure#0}
      19:     0x7f549d6a487a - rustc_middle[ce3fbd8192a3c5ff]::ty::context::tls::with_opt::<rustc_middle[ce3fbd8192a3c5ff]::util::bug::opt_span_bug_fmt<rustc_span[6bc65aeac19990f8]::span_encoding::Span>::{closure#0}, !>::{closure#0}
      20:     0x7f549d6a46fb - rustc_middle[ce3fbd8192a3c5ff]::ty::context::tls::with_context_opt::<rustc_middle[ce3fbd8192a3c5ff]::ty::context::tls::with_opt<rustc_middle[ce3fbd8192a3c5ff]::util::bug::opt_span_bug_fmt<rustc_span[6bc65aeac19990f8]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
      21:     0x7f549bb5dd70 - rustc_middle[ce3fbd8192a3c5ff]::util::bug::bug_fmt
      22:     0x7f549eb00f42 - <rustc_middle[ce3fbd8192a3c5ff]::ty::instance::Instance>::expect_resolve
      23:     0x7f549f3f7d5f - rustc_monomorphize[b056ba09cdf9a699]::collector::collect_items_rec::{closure#0}
      24:     0x7f549e66637f - rustc_monomorphize[b056ba09cdf9a699]::collector::collect_items_rec
      25:     0x7f549e666af6 - rustc_monomorphize[b056ba09cdf9a699]::collector::collect_items_rec
      26:     0x7f549effee27 - rustc_monomorphize[b056ba09cdf9a699]::partitioning::collect_and_partition_mono_items
      27:     0x7f549f3d3364 - rustc_query_impl[9fa61a5fc93b94b6]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9fa61a5fc93b94b6]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ce3fbd8192a3c5ff]::query::erase::Erased<[u8; 24usize]>>
      28:     0x7f549f3d3349 - <rustc_query_impl[9fa61a5fc93b94b6]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2} as core[666eafb1203b88c6]::ops::function::FnOnce<(rustc_middle[ce3fbd8192a3c5ff]::ty::context::TyCtxt, ())>>::call_once
      29:     0x7f549f3d2f08 - rustc_query_system[8cc4c292d92d3869]::query::plumbing::try_execute_query::<rustc_query_impl[9fa61a5fc93b94b6]::DynamicConfig<rustc_query_system[8cc4c292d92d3869]::query::caches::SingleCache<rustc_middle[ce3fbd8192a3c5ff]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[9fa61a5fc93b94b6]::plumbing::QueryCtxt, false>
      30:     0x7f549f3d2c21 - rustc_query_impl[9fa61a5fc93b94b6]::query_impl::collect_and_partition_mono_items::get_query_non_incr::__rust_end_short_backtrace
      31:     0x7f549f0af509 - rustc_codegen_ssa[7de31db090aae023]::back::symbol_export::exported_symbols_provider_local
      32:     0x7f549e7533a5 - rustc_query_impl[9fa61a5fc93b94b6]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9fa61a5fc93b94b6]::query_impl::exported_symbols::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ce3fbd8192a3c5ff]::query::erase::Erased<[u8; 16usize]>>
      33:     0x7f549e753373 - <rustc_query_impl[9fa61a5fc93b94b6]::query_impl::exported_symbols::dynamic_query::{closure#2} as core[666eafb1203b88c6]::ops::function::FnOnce<(rustc_middle[ce3fbd8192a3c5ff]::ty::context::TyCtxt, rustc_span[6bc65aeac19990f8]::def_id::CrateNum)>>::call_once
      34:     0x7f549f23b4b1 - rustc_query_system[8cc4c292d92d3869]::query::plumbing::try_execute_query::<rustc_query_impl[9fa61a5fc93b94b6]::DynamicConfig<rustc_query_system[8cc4c292d92d3869]::query::caches::VecCache<rustc_span[6bc65aeac19990f8]::def_id::CrateNum, rustc_middle[ce3fbd8192a3c5ff]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[9fa61a5fc93b94b6]::plumbing::QueryCtxt, false>
      35:     0x7f549f23b0ab - rustc_query_impl[9fa61a5fc93b94b6]::query_impl::exported_symbols::get_query_non_incr::__rust_end_short_backtrace
      36:     0x7f549f23adec - rustc_middle[ce3fbd8192a3c5ff]::query::plumbing::query_get_at::<rustc_query_system[8cc4c292d92d3869]::query::caches::VecCache<rustc_span[6bc65aeac19990f8]::def_id::CrateNum, rustc_middle[ce3fbd8192a3c5ff]::query::erase::Erased<[u8; 16usize]>>>
      37:     0x7f549ed6e9c0 - <rustc_metadata[d6f8184ef093beb3]::rmeta::encoder::EncodeContext>::encode_crate_root
      38:     0x7f549f5ef046 - rustc_metadata[d6f8184ef093beb3]::rmeta::encoder::encode_metadata
      39:     0x7f549f4255b2 - rustc_metadata[d6f8184ef093beb3]::fs::encode_and_write_metadata
      40:     0x7f549f42405e - rustc_interface[ed174d428a840afd]::passes::start_codegen
      41:     0x7f549f4237a8 - <rustc_interface[ed174d428a840afd]::queries::Queries>::codegen_and_build_linker
      42:     0x7f549f242332 - rustc_interface[ed174d428a840afd]::interface::run_compiler::<core[666eafb1203b88c6]::result::Result<(), rustc_span[6bc65aeac19990f8]::ErrorGuaranteed>, rustc_driver_impl[2627b6be84d2f0c]::run_compiler::{closure#0}>::{closure#1}
      43:     0x7f549f1f6009 - std[59958118404e088f]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ed174d428a840afd]::util::run_in_thread_with_globals<rustc_interface[ed174d428a840afd]::util::run_in_thread_pool_with_globals<rustc_interface[ed174d428a840afd]::interface::run_compiler<core[666eafb1203b88c6]::result::Result<(), rustc_span[6bc65aeac19990f8]::ErrorGuaranteed>, rustc_driver_impl[2627b6be84d2f0c]::run_compiler::{closure#0}>::{closure#1}, core[666eafb1203b88c6]::result::Result<(), rustc_span[6bc65aeac19990f8]::ErrorGuaranteed>>::{closure#0}, core[666eafb1203b88c6]::result::Result<(), rustc_span[6bc65aeac19990f8]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[666eafb1203b88c6]::result::Result<(), rustc_span[6bc65aeac19990f8]::ErrorGuaranteed>>
      44:     0x7f549f1f5dc0 - <<std[59958118404e088f]::thread::Builder>::spawn_unchecked_<rustc_interface[ed174d428a840afd]::util::run_in_thread_with_globals<rustc_interface[ed174d428a840afd]::util::run_in_thread_pool_with_globals<rustc_interface[ed174d428a840afd]::interface::run_compiler<core[666eafb1203b88c6]::result::Result<(), rustc_span[6bc65aeac19990f8]::ErrorGuaranteed>, rustc_driver_impl[2627b6be84d2f0c]::run_compiler::{closure#0}>::{closure#1}, core[666eafb1203b88c6]::result::Result<(), rustc_span[6bc65aeac19990f8]::ErrorGuaranteed>>::{closure#0}, core[666eafb1203b88c6]::result::Result<(), rustc_span[6bc65aeac19990f8]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[666eafb1203b88c6]::result::Result<(), rustc_span[6bc65aeac19990f8]::ErrorGuaranteed>>::{closure#2} as core[666eafb1203b88c6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
      45:     0x7f5499f65e4b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1f264a7d3d0a179d
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/alloc/src/boxed.rs:2063:9
      46:     0x7f5499f65e4b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h137c7bc9bcca4c45
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/alloc/src/boxed.rs:2063:9
      47:     0x7f5499f65e4b - std::sys::pal::unix::thread::Thread::new::thread_start::hf2fbd4f8eae045d7
                                   at /rustc/804421dff5542c9c7da5c60257b5dbc849719505/library/std/src/sys/pal/unix/thread.rs:108:17
      48:     0x7f5499e73609 - start_thread
      49:     0x7f5499d96353 - clone
      50:                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 `/playground/rustc-ice-2024-06-08T09_09_04-50.txt` to your bug report
    
    note: compiler flags: --crate-type lib -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2
    
    note: some of the compiler flags provided by cargo are hidden
    
    query stack during panic:
    #0 [collect_and_partition_mono_items] collect_and_partition_mono_items
    #1 [exported_symbols] collecting exported symbols for crate `0`
    end of query stack
    error: could not compile `playground` (lib)
    
  8. added a commit that references this issue on May 2, 2026
    a3e96d8
  9. added a commit that references this issue on May 3, 2026
    5f42201
  10. added a commit that references this issue on May 4, 2026
    1a61ee9
  11. added a commit that references this issue on May 4, 2026
    8ba75fb
  12. added a commit that references this issue on Aug 7, 2026
    191de24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-generic_const_exprs`#![feature(generic_const_exprs)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-lowLow priorityS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions