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: Normalization of 'ty::ConstKind::Expr' is unimplemented #132960

Open
matthiaskrgr opened this issue Nov 12, 2024 · 3 comments
Open

ICE: Normalization of 'ty::ConstKind::Expr' is unimplemented #132960

matthiaskrgr opened this issue Nov 12, 2024 · 3 comments
Assignees
Labels
A-const-generics Area: const generics (parameters and arguments) 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) ❄️ 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

auto-reduced (treereduce-rust):

//@compile-flags: --crate-type=lib
#![feature(unsized_const_params)]
#![feature(adt_const_params, const_ptr_read, generic_const_exprs)]

use std::mem::ManuallyDrop;

const fn concat_strs<const A: &'static str, const B: &'static str>() -> &'static str
where
    [(); A.len()]:,
    [(); B.len()]:,
    [(); A.len() + B.len()]:,
{
    #[repr(C)]
    struct ConcatJoin<const N: usize, const M: usize> {
        left: [u8; N],
        right: [u8; M],
    }

    #[repr(C)]
    union ConcatJoiner<const N: usize, const M: usize>
    where
        [(); N + M]:,
    {
        whole: ManuallyDrop<[u8; N + M]>,
        split: ManuallyDrop<ConcatJoin<N, M>>,
    }

    const fn concat_arr<const M: usize, const N: usize>(a: [u8; M], b: [u8; N]) -> [u8; M + N] {
        unsafe {
            let joiner = ConcatJoiner {
                split: ManuallyDrop::new(ConcatJoin { left: a, right: b }),
            };
            let join = joiner.whole;
            ManuallyDrop::into_inner(join)
        }
    }

    struct Inner<const A: &'static str, const B: &'static str>;
    impl<const A: &'static str, const B: &'static str> Inner<A, B>
    where
        [(); A.len()]:,
        [(); B.len()]:,
        [(); A.len() + B.len()]:,
    {
        const ABSTR: &'static str = unsafe {
            std::str::from_utf8_unchecked(&concat_arr(
                A.as_ptr().cast().read(),
                B.as_ptr().cast().read(),
            ))
        };
    }

    Inner::<A, B>::ABSTR
}

const FOO: &str = "foo";
const BAR: &str = "bar";
const FOOBAR: &str = concat_strs::<FOO, BAR>();
original code

original:

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

use std::mem::ManuallyDrop;

const fn concat_strs<const A: &'static str, const B: &'static str>() -> &'static str
where
    [(); A.len()]:,
    [(); B.len()]:,
    [(); A.len() + B.len()]:,
{
    #[repr(C)]
    struct ConcatJoin<const N: usize, const M: usize> {
        left: [u8; N],
        right: [u8; M],
    }

    #[repr(C)]
    union ConcatJoiner<const N: usize, const M: usize>
    where
        [(); N + M]:,
    {
        whole: ManuallyDrop<[u8; N + M]>,
        split: ManuallyDrop<ConcatJoin<N, M>>,
    }

    const fn concat_arr<const M: usize, const N: usize>(a: [u8; M], b: [u8; N]) -> [u8; M + N]
    where
        [(); M + N]:,
    {
        unsafe {
            let joiner = ConcatJoiner {
                split: ManuallyDrop::new(ConcatJoin { left: a, right: b }),
            };
            let join = joiner.whole;
            ManuallyDrop::into_inner(join)
        }
    }

    struct Inner<const A: &'static str, const B: &'static str>;
    impl<const A: &'static str, const B: &'static str> Inner<A, B>
    where
        [(); A.len()]:,
        [(); B.len()]:,
        [(); A.len() + B.len()]:,
    {
        const ABSTR: &'static str = unsafe {
            std::str::from_utf8_unchecked(&concat_arr(
                A.as_ptr().cast::<[u8; A.len()]>().read(),
                B.as_ptr().cast::<[u8; B.len()]>().read(),
            ))
        };
    }

    Inner::<A, B>::ABSTR
}

const FOO: &str = "foo";
const BAR: &str = "bar";
const FOOBAR: &str = concat_strs::<FOO, BAR>();

Version information

rustc 1.84.0-nightly (6503543d1 2024-11-12)
binary: rustc
commit-hash: 6503543d11583d1686d4989847b2afbec8d9fdba
commit-date: 2024-11-12
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.3

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zcrate-attr=feature(unsized_const_params) --crate-type=lib

Program output

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

warning: the feature `unsized_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
 --> <crate attribute>:1:9
  |
1 | feature(unsized_const_params)
  |         ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information

warning: the feature `const_ptr_read` has been stable since 1.71.0 and no longer requires an attribute to enable
 --> /tmp/icemaker_global_tempdir.M7QGlwHPHRjj/rustc_testrunner_tmpdir_reporting.Pgzdb9IPCHkV/mvce.rs:1:30
  |
1 | #![feature(adt_const_params, const_ptr_read, generic_const_exprs)]
  |                              ^^^^^^^^^^^^^^
  |
  = note: `#[warn(stable_features)]` on by default

warning: type annotations needed
  --> /tmp/icemaker_global_tempdir.M7QGlwHPHRjj/rustc_testrunner_tmpdir_reporting.Pgzdb9IPCHkV/mvce.rs:45:35
   |
45 |                 A.as_ptr().cast().read(),
   |                                   ^^^^
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
   = note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>
   = note: `#[warn(tyvar_behind_raw_pointer)]` on by default

warning: type annotations needed
  --> /tmp/icemaker_global_tempdir.M7QGlwHPHRjj/rustc_testrunner_tmpdir_reporting.Pgzdb9IPCHkV/mvce.rs:46:35
   |
46 |                 B.as_ptr().cast().read(),
   |                                   ^^^^
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
   = note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>

warning: function `concat_strs` is never used
 --> /tmp/icemaker_global_tempdir.M7QGlwHPHRjj/rustc_testrunner_tmpdir_reporting.Pgzdb9IPCHkV/mvce.rs:5:10
  |
5 | const fn concat_strs<const A: &'static str, const B: &'static str>() -> &'static str
  |          ^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: associated constant `ABSTR` is never used
  --> /tmp/icemaker_global_tempdir.M7QGlwHPHRjj/rustc_testrunner_tmpdir_reporting.Pgzdb9IPCHkV/mvce.rs:43:15
   |
37 | /     impl<const A: &'static str, const B: &'static str> Inner<A, B>
38 | |     where
39 | |         [(); A.len()]:,
40 | |         [(); B.len()]:,
41 | |         [(); A.len() + B.len()]:,
   | |_________________________________- associated constant in this implementation
42 |       {
43 |           const ABSTR: &'static str = unsafe {
   |                 ^^^^^

warning: constant `FOO` is never used
  --> /tmp/icemaker_global_tempdir.M7QGlwHPHRjj/rustc_testrunner_tmpdir_reporting.Pgzdb9IPCHkV/mvce.rs:54:7
   |
54 | const FOO: &str = "foo";
   |       ^^^

warning: constant `BAR` is never used
  --> /tmp/icemaker_global_tempdir.M7QGlwHPHRjj/rustc_testrunner_tmpdir_reporting.Pgzdb9IPCHkV/mvce.rs:55:7
   |
55 | const BAR: &str = "bar";
   |       ^^^

warning: constant `FOOBAR` is never used
  --> /tmp/icemaker_global_tempdir.M7QGlwHPHRjj/rustc_testrunner_tmpdir_reporting.Pgzdb9IPCHkV/mvce.rs:56:7
   |
56 | const FOOBAR: &str = concat_strs::<FOO, BAR>();
   |       ^^^^^^

warning: 10 warnings 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: Unevaluated `ty::Const` in MIR body
  |
  = note: delayed at /rustc/6503543d11583d1686d4989847b2afbec8d9fdba/compiler/rustc_middle/src/mir/consts.rs:328:40 - disabled backtrace

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.84.0-nightly (6503543d1 2024-11-12) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z crate-attr=feature(unsized_const_params) --crate-type lib -Z dump-mir-dir=dir

query stack during panic:
end of query stack

@rustbot label +F-adt_const_params +F-const_ptr_read +F-generic_const_exprs +F-unsized_const_params

@matthiaskrgr matthiaskrgr added C-bug Category: This is a bug. 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. labels Nov 12, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 12, 2024
@matthiaskrgr
Copy link
Member Author

bisects to #132927 as well

@matthiaskrgr matthiaskrgr changed the title ICE: `Unevaluated 'ty::Const' in MIR body' ICE: Unevaluated 'ty::Const' in MIR body Nov 12, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 12, 2024
@BoxyUwU BoxyUwU self-assigned this Nov 12, 2024
@BoxyUwU
Copy link
Member

BoxyUwU commented Nov 12, 2024

This is another case of generic_const_exprs producing unevaluated consts that we don't have the machinery to normalize, I don't see this ever getting fixed

@BoxyUwU BoxyUwU added A-const-generics Area: const generics (parameters and arguments) F-generic_const_exprs `#![feature(generic_const_exprs)]` labels Nov 13, 2024
@matthiaskrgr matthiaskrgr changed the title ICE: Unevaluated 'ty::Const' in MIR body ICE: Normalization of 'ty::ConstKind::Expr' is unimplemented Nov 14, 2024
@matthiaskrgr
Copy link
Member Author

auto-reduced (treereduce-rust):

#![feature(adt_const_params, const_ptr_read, generic_const_exprs)]

const fn concat_strs<const A: &'static str, const B: &'static str>() -> &'static str
where
    [(); A.len()]:,
    [(); B.len()]:,
    [(); A.len() + B.len()]:,
{
    #[repr(C)]
    #[repr(C)]

    const fn concat_arr<const M: usize, const N: usize>(a: [u8; M], b: [u8; N]) -> [u8; M + N] {}

    struct Inner<const A: &'static str, const B: &'static str>;
    impl<const A: &'static str, const B: &'static str> Inner<A, B>
    where
        [(); A.len()]:,
        [(); B.len()]:,
        [(); A.len() + B.len()]:,
    {
        const ABSTR: &'static str = unsafe {
            std::str::from_utf8_unchecked(&concat_arr(
                A.as_ptr().cast().read(),
                B.as_ptr().cast().read(),
            ))
        };
    }

    Inner::<A, B>::ABSTR
}

const FOO: &str = "foo";
const BAR: &str = "bar";
const FOOBAR: &str = concat_strs::<FOO, BAR>();
original code

original:

#![feature(unsized_const_params)]
#![feature(adt_const_params, const_ptr_read, generic_const_exprs)]

use std::mem::ManuallyDrop;

const fn concat_strs<const A: &'static str, const B: &'static str>() -> &'static str
where
    [(); A.len()]:,
    [(); B.len()]:,
    [(); A.len() + B.len()]:,
{
    #[repr(C)]
    struct ConcatJoin<const N: usize, const M: usize> {
        left: [u8; N],
        right: [u8; M],
    }

    #[repr(C)]
    union ConcatJoiner<const N: usize, const M: usize>
    where
        [(); N + M]:,
    {
        whole: ManuallyDrop<[u8; N + M]>,
        split: ManuallyDrop<ConcatJoin<N, M>>,
    }

    const fn concat_arr<const M: usize, const N: usize>(a: [u8; M], b: [u8; N]) -> [u8; M + N] {
        unsafe {
            let joiner = ConcatJoiner {
                split: ManuallyDrop::new(ConcatJoin { left: a, right: b }),
            };
            let join = joiner.whole;
            ManuallyDrop::into_inner(join)
        }
    }

    struct Inner<const A: &'static str, const B: &'static str>;
    impl<const A: &'static str, const B: &'static str> Inner<A, B>
    where
        [(); A.len()]:,
        [(); B.len()]:,
        [(); A.len() + B.len()]:,
    {
        const ABSTR: &'static str = unsafe {
            std::str::from_utf8_unchecked(&concat_arr(
                A.as_ptr().cast().read(),
                B.as_ptr().cast().read(),
            ))
        };
    }

    Inner::<A, B>::ABSTR
}

const FOO: &str = "foo";
const BAR: &str = "bar";
const FOOBAR: &str = concat_strs::<FOO, BAR>();

Version information

rustc 1.84.0-nightly (dae7ac133 2024-11-14)
binary: rustc
commit-hash: dae7ac133b9eda152784c075facb31a6688c92b1
commit-date: 2024-11-14
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.3

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

Program output

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:1:46
  |
1 | #![feature(adt_const_params, const_ptr_read, generic_const_exprs)]
  |                                              ^^^^^^^^^^^^^^^^^^^
  |
  = 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.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:34:48
   |
34 | const FOOBAR: &str = concat_strs::<FOO, BAR>();
   |                                                ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs`

error[E0517]: attribute should be applied to a struct, enum, or union
  --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:9:12
   |
9  |     #[repr(C)]
   |            ^
...
12 |     const fn concat_arr<const M: usize, const N: usize>(a: [u8; M], b: [u8; N]) -> [u8; M + N] {}
   |     --------------------------------------------------------------------------------------------- not a struct, enum, or union

error[E0517]: attribute should be applied to a struct, enum, or union
  --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:10:12
   |
10 |     #[repr(C)]
   |            ^
11 |
12 |     const fn concat_arr<const M: usize, const N: usize>(a: [u8; M], b: [u8; N]) -> [u8; M + N] {}
   |     --------------------------------------------------------------------------------------------- not a struct, enum, or union

warning: the feature `const_ptr_read` has been stable since 1.71.0 and no longer requires an attribute to enable
 --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:1:30
  |
1 | #![feature(adt_const_params, const_ptr_read, generic_const_exprs)]
  |                              ^^^^^^^^^^^^^^
  |
  = note: `#[warn(stable_features)]` on by default

error[E0741]: `&'static str` can't be used as a const parameter type
 --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:3:31
  |
3 | const fn concat_strs<const A: &'static str, const B: &'static str>() -> &'static str
  |                               ^^^^^^^^^^^^

error[E0741]: `&'static str` can't be used as a const parameter type
 --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:3:54
  |
3 | const fn concat_strs<const A: &'static str, const B: &'static str>() -> &'static str
  |                                                      ^^^^^^^^^^^^

error[E0741]: `&'static str` can't be used as a const parameter type
  --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:14:27
   |
14 |     struct Inner<const A: &'static str, const B: &'static str>;
   |                           ^^^^^^^^^^^^

error[E0741]: `&'static str` can't be used as a const parameter type
  --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:14:50
   |
14 |     struct Inner<const A: &'static str, const B: &'static str>;
   |                                                  ^^^^^^^^^^^^

error[E0741]: `&'static str` can't be used as a const parameter type
  --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:15:19
   |
15 |     impl<const A: &'static str, const B: &'static str> Inner<A, B>
   |                   ^^^^^^^^^^^^

error[E0741]: `&'static str` can't be used as a const parameter type
  --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:15:42
   |
15 |     impl<const A: &'static str, const B: &'static str> Inner<A, B>
   |                                          ^^^^^^^^^^^^

warning: type annotations needed
  --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:23:35
   |
23 |                 A.as_ptr().cast().read(),
   |                                   ^^^^
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
   = note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>
   = note: `#[warn(tyvar_behind_raw_pointer)]` on by default

warning: type annotations needed
  --> /tmp/icemaker_global_tempdir.iuqByQrfz5jL/rustc_testrunner_tmpdir_reporting.SDTdkUk4Vc0a/mvce.rs:24:35
   |
24 |                 B.as_ptr().cast().read(),
   |                                   ^^^^
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
   = note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>

error: internal compiler error: /rustc/dae7ac133b9eda152784c075facb31a6688c92b1/compiler/rustc_middle/src/mir/consts.rs:329:25: Normalization of `ty::ConstKind::Expr` is unimplemented

thread 'rustc' panicked at /rustc/dae7ac133b9eda152784c075facb31a6688c92b1/compiler/rustc_middle/src/mir/consts.rs:329:25:
Box<dyn Any>
stack backtrace:
   0:     0x797098060e2a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h0326228ddf29829f
   1:     0x79709880448a - core::fmt::write::h64d957f6c2411f92
   2:     0x797099c2ba91 - std::io::Write::write_fmt::hf76d6982f9e040f9
   3:     0x797098060c82 - std::sys::backtrace::BacktraceLock::print::h527aa5f4f2853fd7
   4:     0x797098063186 - std::panicking::default_hook::{{closure}}::h784a8d655f3ea3ba
   5:     0x797098062fd0 - std::panicking::default_hook::h74432acd085bbcae
   6:     0x7970970ea111 - std[7b46ba15e6836155]::panicking::update_hook::<alloc[98de7c120457b6b8]::boxed::Box<rustc_driver_impl[e3223cb9277a66be]::install_ice_hook::{closure#0}>>::{closure#0}
   7:     0x797098063898 - std::panicking::rust_panic_with_hook::h11fa623022ff3898
   8:     0x797097123ca1 - std[7b46ba15e6836155]::panicking::begin_panic::<rustc_errors[7141fd9760fe76b8]::ExplicitBug>::{closure#0}
   9:     0x797097116c76 - std[7b46ba15e6836155]::sys::backtrace::__rust_end_short_backtrace::<std[7b46ba15e6836155]::panicking::begin_panic<rustc_errors[7141fd9760fe76b8]::ExplicitBug>::{closure#0}, !>
  10:     0x797097116a03 - std[7b46ba15e6836155]::panicking::begin_panic::<rustc_errors[7141fd9760fe76b8]::ExplicitBug>
  11:     0x79709712d9b1 - <rustc_errors[7141fd9760fe76b8]::diagnostic::BugAbort as rustc_errors[7141fd9760fe76b8]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7970977ae563 - rustc_middle[718f3a24ace21c73]::util::bug::opt_span_bug_fmt::<rustc_span[6e39dd2eacb7e146]::span_encoding::Span>::{closure#0}
  13:     0x797097794daa - rustc_middle[718f3a24ace21c73]::ty::context::tls::with_opt::<rustc_middle[718f3a24ace21c73]::util::bug::opt_span_bug_fmt<rustc_span[6e39dd2eacb7e146]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x797097794c3b - rustc_middle[718f3a24ace21c73]::ty::context::tls::with_context_opt::<rustc_middle[718f3a24ace21c73]::ty::context::tls::with_opt<rustc_middle[718f3a24ace21c73]::util::bug::opt_span_bug_fmt<rustc_span[6e39dd2eacb7e146]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x797095afdb20 - rustc_middle[718f3a24ace21c73]::util::bug::bug_fmt
  16:     0x7970993b2395 - <rustc_const_eval[4c4ef20f97f27f90]::interpret::eval_context::InterpCx<rustc_const_eval[4c4ef20f97f27f90]::const_eval::machine::CompileTimeMachine>>::push_stack_frame_raw
  17:     0x7970993bb435 - rustc_const_eval[4c4ef20f97f27f90]::const_eval::eval_queries::eval_to_allocation_raw_provider
  18:     0x7970993baef6 - rustc_query_impl[8ecd2df6873dbce8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>
  19:     0x7970993b5ecb - rustc_query_system[c7eb5a30f78388e]::query::plumbing::try_execute_query::<rustc_query_impl[8ecd2df6873dbce8]::DynamicConfig<rustc_query_system[c7eb5a30f78388e]::query::caches::DefaultCache<rustc_middle[718f3a24ace21c73]::ty::ParamEnvAnd<rustc_middle[718f3a24ace21c73]::mir::interpret::GlobalId>, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[8ecd2df6873dbce8]::plumbing::QueryCtxt, false>
  20:     0x7970993b5aaf - rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  21:     0x79709937e726 - rustc_const_eval[4c4ef20f97f27f90]::const_eval::valtrees::eval_to_valtree
  22:     0x79709937e549 - <rustc_const_eval[4c4ef20f97f27f90]::provide::{closure#0} as core[3ad726d5cba1884b]::ops::function::FnOnce<(rustc_middle[718f3a24ace21c73]::ty::context::TyCtxt, rustc_middle[718f3a24ace21c73]::ty::ParamEnvAnd<rustc_middle[718f3a24ace21c73]::mir::interpret::GlobalId>)>>::call_once
  23:     0x79709937e500 - rustc_query_impl[8ecd2df6873dbce8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_valtree::dynamic_query::{closure#2}::{closure#0}, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>
  24:     0x79709937e4c1 - <rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_valtree::dynamic_query::{closure#2} as core[3ad726d5cba1884b]::ops::function::FnOnce<(rustc_middle[718f3a24ace21c73]::ty::context::TyCtxt, rustc_middle[718f3a24ace21c73]::ty::ParamEnvAnd<rustc_middle[718f3a24ace21c73]::mir::interpret::GlobalId>)>>::call_once
  25:     0x7970993b5f9f - rustc_query_system[c7eb5a30f78388e]::query::plumbing::try_execute_query::<rustc_query_impl[8ecd2df6873dbce8]::DynamicConfig<rustc_query_system[c7eb5a30f78388e]::query::caches::DefaultCache<rustc_middle[718f3a24ace21c73]::ty::ParamEnvAnd<rustc_middle[718f3a24ace21c73]::mir::interpret::GlobalId>, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[8ecd2df6873dbce8]::plumbing::QueryCtxt, false>
  26:     0x7970993b58c7 - rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_valtree::get_query_non_incr::__rust_end_short_backtrace
  27:     0x79709926a30e - rustc_middle[718f3a24ace21c73]::query::plumbing::query_get_at::<rustc_query_system[c7eb5a30f78388e]::query::caches::DefaultCache<rustc_middle[718f3a24ace21c73]::ty::ParamEnvAnd<rustc_middle[718f3a24ace21c73]::mir::interpret::GlobalId>, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>>
  28:     0x797099269d97 - <rustc_middle[718f3a24ace21c73]::ty::context::TyCtxt>::const_eval_global_id_for_typeck
  29:     0x7970992695bc - <rustc_middle[718f3a24ace21c73]::ty::context::TyCtxt>::const_eval_resolve_for_typeck
  30:     0x797099269301 - rustc_trait_selection[ade120a59c9ca055]::traits::try_evaluate_const
  31:     0x7970992684f6 - <rustc_trait_selection[ade120a59c9ca055]::traits::query::normalize::QueryNormalizer as rustc_type_ir[b43b485fe23eb35c]::fold::FallibleTypeFolder<rustc_middle[718f3a24ace21c73]::ty::context::TyCtxt>>::try_fold_const
  32:     0x797098e90e21 - <rustc_trait_selection[ade120a59c9ca055]::traits::query::normalize::QueryNormalizer as rustc_type_ir[b43b485fe23eb35c]::fold::FallibleTypeFolder<rustc_middle[718f3a24ace21c73]::ty::context::TyCtxt>>::try_fold_ty
  33:     0x797098e90673 - <rustc_trait_selection[ade120a59c9ca055]::traits::query::normalize::QueryNormalizer as rustc_type_ir[b43b485fe23eb35c]::fold::FallibleTypeFolder<rustc_middle[718f3a24ace21c73]::ty::context::TyCtxt>>::try_fold_ty
  34:     0x797098e8ccd1 - <rustc_traits[6c6b9219dd2d98c9]::normalize_erasing_regions::provide::{closure#0} as core[3ad726d5cba1884b]::ops::function::FnOnce<(rustc_middle[718f3a24ace21c73]::ty::context::TyCtxt, rustc_middle[718f3a24ace21c73]::ty::ParamEnvAnd<rustc_middle[718f3a24ace21c73]::ty::generic_args::GenericArg>)>>::call_once
  35:     0x797098e8c947 - rustc_query_impl[8ecd2df6873dbce8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8ecd2df6873dbce8]::query_impl::try_normalize_generic_arg_after_erasing_regions::dynamic_query::{closure#2}::{closure#0}, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 8usize]>>
  36:     0x797098e8c059 - rustc_query_system[c7eb5a30f78388e]::query::plumbing::try_execute_query::<rustc_query_impl[8ecd2df6873dbce8]::DynamicConfig<rustc_query_system[c7eb5a30f78388e]::query::caches::DefaultCache<rustc_middle[718f3a24ace21c73]::ty::ParamEnvAnd<rustc_middle[718f3a24ace21c73]::ty::generic_args::GenericArg>, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[8ecd2df6873dbce8]::plumbing::QueryCtxt, false>
  37:     0x797098e8bda0 - rustc_query_impl[8ecd2df6873dbce8]::query_impl::try_normalize_generic_arg_after_erasing_regions::get_query_non_incr::__rust_end_short_backtrace
  38:     0x797098e87efd - <rustc_middle[718f3a24ace21c73]::ty::normalize_erasing_regions::TryNormalizeAfterErasingRegionsFolder as rustc_type_ir[b43b485fe23eb35c]::fold::FallibleTypeFolder<rustc_middle[718f3a24ace21c73]::ty::context::TyCtxt>>::try_fold_ty
  39:     0x7970993b1d64 - <rustc_const_eval[4c4ef20f97f27f90]::interpret::eval_context::InterpCx<rustc_const_eval[4c4ef20f97f27f90]::const_eval::machine::CompileTimeMachine>>::push_stack_frame_raw
  40:     0x7970993bb435 - rustc_const_eval[4c4ef20f97f27f90]::const_eval::eval_queries::eval_to_allocation_raw_provider
  41:     0x7970993baef6 - rustc_query_impl[8ecd2df6873dbce8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>
  42:     0x7970993b5ecb - rustc_query_system[c7eb5a30f78388e]::query::plumbing::try_execute_query::<rustc_query_impl[8ecd2df6873dbce8]::DynamicConfig<rustc_query_system[c7eb5a30f78388e]::query::caches::DefaultCache<rustc_middle[718f3a24ace21c73]::ty::ParamEnvAnd<rustc_middle[718f3a24ace21c73]::mir::interpret::GlobalId>, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[8ecd2df6873dbce8]::plumbing::QueryCtxt, false>
  43:     0x7970993b5aaf - rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  44:     0x7970993b7115 - rustc_const_eval[4c4ef20f97f27f90]::const_eval::eval_queries::eval_to_const_value_raw_provider
  45:     0x7970993b6f36 - rustc_query_impl[8ecd2df6873dbce8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>
  46:     0x7970993b5e8e - rustc_query_system[c7eb5a30f78388e]::query::plumbing::try_execute_query::<rustc_query_impl[8ecd2df6873dbce8]::DynamicConfig<rustc_query_system[c7eb5a30f78388e]::query::caches::DefaultCache<rustc_middle[718f3a24ace21c73]::ty::ParamEnvAnd<rustc_middle[718f3a24ace21c73]::mir::interpret::GlobalId>, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[8ecd2df6873dbce8]::plumbing::QueryCtxt, false>
  47:     0x7970993b59b1 - rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
  48:     0x797099276ce2 - <rustc_middle[718f3a24ace21c73]::ty::context::TyCtxt>::const_eval_resolve
  49:     0x7970992ae4e4 - <rustc_const_eval[4c4ef20f97f27f90]::interpret::eval_context::InterpCx<rustc_const_eval[4c4ef20f97f27f90]::const_eval::machine::CompileTimeMachine>>::init_stack_frame
  50:     0x7970992aacc4 - <rustc_const_eval[4c4ef20f97f27f90]::interpret::eval_context::InterpCx<rustc_const_eval[4c4ef20f97f27f90]::const_eval::machine::CompileTimeMachine>>::init_fn_call
  51:     0x7970993bcd57 - rustc_const_eval[4c4ef20f97f27f90]::const_eval::eval_queries::eval_to_allocation_raw_provider
  52:     0x7970993baef6 - rustc_query_impl[8ecd2df6873dbce8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>
  53:     0x7970993b5ecb - rustc_query_system[c7eb5a30f78388e]::query::plumbing::try_execute_query::<rustc_query_impl[8ecd2df6873dbce8]::DynamicConfig<rustc_query_system[c7eb5a30f78388e]::query::caches::DefaultCache<rustc_middle[718f3a24ace21c73]::ty::ParamEnvAnd<rustc_middle[718f3a24ace21c73]::mir::interpret::GlobalId>, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[8ecd2df6873dbce8]::plumbing::QueryCtxt, false>
  54:     0x7970993b5aaf - rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  55:     0x7970993b7115 - rustc_const_eval[4c4ef20f97f27f90]::const_eval::eval_queries::eval_to_const_value_raw_provider
  56:     0x7970993b6f36 - rustc_query_impl[8ecd2df6873dbce8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>
  57:     0x7970993b5e8e - rustc_query_system[c7eb5a30f78388e]::query::plumbing::try_execute_query::<rustc_query_impl[8ecd2df6873dbce8]::DynamicConfig<rustc_query_system[c7eb5a30f78388e]::query::caches::DefaultCache<rustc_middle[718f3a24ace21c73]::ty::ParamEnvAnd<rustc_middle[718f3a24ace21c73]::mir::interpret::GlobalId>, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[8ecd2df6873dbce8]::plumbing::QueryCtxt, false>
  58:     0x7970993b59b1 - rustc_query_impl[8ecd2df6873dbce8]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
  59:     0x797098cf8337 - <rustc_middle[718f3a24ace21c73]::hir::map::Map>::par_body_owners::<rustc_hir_analysis[62137f5816008ffb]::check_crate::{closure#3}>::{closure#0}
  60:     0x797098cf5cf1 - rustc_hir_analysis[62137f5816008ffb]::check_crate
  61:     0x797098d2024a - rustc_interface[5830f67c2b583706]::passes::run_required_analyses
  62:     0x797099637b1e - rustc_interface[5830f67c2b583706]::passes::analysis
  63:     0x797099637aef - rustc_query_impl[8ecd2df6873dbce8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8ecd2df6873dbce8]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 1usize]>>
  64:     0x7970997ce36e - rustc_query_system[c7eb5a30f78388e]::query::plumbing::try_execute_query::<rustc_query_impl[8ecd2df6873dbce8]::DynamicConfig<rustc_query_system[c7eb5a30f78388e]::query::caches::SingleCache<rustc_middle[718f3a24ace21c73]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[8ecd2df6873dbce8]::plumbing::QueryCtxt, false>
  65:     0x7970997ce04e - rustc_query_impl[8ecd2df6873dbce8]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  66:     0x7970996c9bfa - rustc_interface[5830f67c2b583706]::interface::run_compiler::<core[3ad726d5cba1884b]::result::Result<(), rustc_span[6e39dd2eacb7e146]::ErrorGuaranteed>, rustc_driver_impl[e3223cb9277a66be]::run_compiler::{closure#0}>::{closure#1}
  67:     0x7970997186d0 - std[7b46ba15e6836155]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[5830f67c2b583706]::util::run_in_thread_with_globals<rustc_interface[5830f67c2b583706]::util::run_in_thread_pool_with_globals<rustc_interface[5830f67c2b583706]::interface::run_compiler<core[3ad726d5cba1884b]::result::Result<(), rustc_span[6e39dd2eacb7e146]::ErrorGuaranteed>, rustc_driver_impl[e3223cb9277a66be]::run_compiler::{closure#0}>::{closure#1}, core[3ad726d5cba1884b]::result::Result<(), rustc_span[6e39dd2eacb7e146]::ErrorGuaranteed>>::{closure#0}, core[3ad726d5cba1884b]::result::Result<(), rustc_span[6e39dd2eacb7e146]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3ad726d5cba1884b]::result::Result<(), rustc_span[6e39dd2eacb7e146]::ErrorGuaranteed>>
  68:     0x797099718aeb - <<std[7b46ba15e6836155]::thread::Builder>::spawn_unchecked_<rustc_interface[5830f67c2b583706]::util::run_in_thread_with_globals<rustc_interface[5830f67c2b583706]::util::run_in_thread_pool_with_globals<rustc_interface[5830f67c2b583706]::interface::run_compiler<core[3ad726d5cba1884b]::result::Result<(), rustc_span[6e39dd2eacb7e146]::ErrorGuaranteed>, rustc_driver_impl[e3223cb9277a66be]::run_compiler::{closure#0}>::{closure#1}, core[3ad726d5cba1884b]::result::Result<(), rustc_span[6e39dd2eacb7e146]::ErrorGuaranteed>>::{closure#0}, core[3ad726d5cba1884b]::result::Result<(), rustc_span[6e39dd2eacb7e146]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3ad726d5cba1884b]::result::Result<(), rustc_span[6e39dd2eacb7e146]::ErrorGuaranteed>>::{closure#1} as core[3ad726d5cba1884b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  69:     0x7970997195b9 - std::sys::pal::unix::thread::Thread::new::thread_start::h8cc9e4846fbebb95
  70:     0x79709af5f39d - <unknown>
  71:     0x79709afe449c - <unknown>
  72:                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: rustc 1.84.0-nightly (dae7ac133 2024-11-14) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `concat_strs::concat_arr::{constant#0}`
#1 [eval_to_valtree] evaluating type-level constant
end of query stack
error: aborting due to 10 previous errors; 4 warnings emitted

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

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-generic_const_exprs `#![feature(generic_const_exprs)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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

4 participants