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: expected usize, got UnevaluatedConst #116186

Closed
matthiaskrgr opened this issue Sep 26, 2023 · 1 comment · Fixed by #117046
Closed

ICE: expected usize, got UnevaluatedConst #116186

matthiaskrgr opened this issue Sep 26, 2023 · 1 comment · Fixed by #117046
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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

rustc --edition=2018

#![feature(generic_const_exprs)]

pub async fn something(path: &[[usize; N_ISLANDS]; N_ISLANDS]) -> usize {
    async {
        match path {
            [] => 0,

            _ => 1,
        }
    }
    .await
}

Meta

rustc --version --verbose:

rustc 1.74.0-nightly (0288f2e19 2023-09-25)
binary: rustc
commit-hash: 0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa
commit-date: 2023-09-25
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0

Error output

error[E0425]: cannot find value `N_ISLANDS` in this scope
 --> icemaker_reduced/112607.rs:3:40
  |
3 | pub async fn something(path: &[[usize; N_ISLANDS]; N_ISLANDS]) -> usize {
  |                                        ^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `N_ISLANDS` in this scope
 --> icemaker_reduced/112607.rs:3:52
  |
3 | pub async fn something(path: &[[usize; N_ISLANDS]; N_ISLANDS]) -> usize {
  |                                                    ^^^^^^^^^ not found in this scope

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> icemaker_reduced/112607.rs:1:12
  |
1 | #![feature(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 `112607`
  --> icemaker_reduced/112607.rs:12:2
   |
12 | }
   |  ^ consider adding a `main` function to `icemaker_reduced/112607.rs`

Backtrace

error: internal compiler error: /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/compiler/rustc_middle/src/ty/consts.rs:375:32: expected usize, got UnevaluatedConst { def: DefId(0:5 ~ 112607[dbca]::something::{constant#1}), args: [] }: usize

thread 'rustc' panicked at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/compiler/rustc_errors/src/lib.rs:1651:9:
Box<dyn Any>
stack backtrace:
   0:     0x7f0b99d6427c - std::backtrace_rs::backtrace::libunwind::trace::he0fa95863765c162
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f0b99d6427c - std::backtrace_rs::backtrace::trace_unsynchronized::h72d5f99a2861d02b
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f0b99d6427c - std::sys_common::backtrace::_print_fmt::h77a4706f5ef94d01
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f0b99d6427c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he943404fecf038b0
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f0b99dc9edc - core::fmt::rt::Argument::fmt::h13be5e824c591ca7
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/core/src/fmt/rt.rs:138:9
   5:     0x7f0b99dc9edc - core::fmt::write::hf0c0a3e365f4aeb2
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/core/src/fmt/mod.rs:1114:21
   6:     0x7f0b99d56ffe - std::io::Write::write_fmt::hf6231d334faed5a2
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/std/src/io/mod.rs:1763:15
   7:     0x7f0b99d64064 - std::sys_common::backtrace::_print::h94947374abf91134
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f0b99d64064 - std::sys_common::backtrace::print::h7f67412f149682a2
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f0b99d66f43 - std::panicking::default_hook::{{closure}}::h0b1ce8078274efb2
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/std/src/panicking.rs:272:22
  10:     0x7f0b99d66c64 - std::panicking::default_hook::h730577ca09276893
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/std/src/panicking.rs:292:9
  11:     0x7f0b9ceeaeef - std[c0c5954477cb1558]::panicking::update_hook::<alloc[23fe904eb05f20cb]::boxed::Box<rustc_driver_impl[e02b405ddf0b953d]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f0b99d67771 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hd44a804e253f6339
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/alloc/src/boxed.rs:2021:9
  13:     0x7f0b99d67771 - std::panicking::rust_panic_with_hook::h1935709438ad84cd
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/std/src/panicking.rs:735:13
  14:     0x7f0b9d440b74 - std[c0c5954477cb1558]::panicking::begin_panic::<rustc_errors[489c792d0b298f43]::ExplicitBug>::{closure#0}
  15:     0x7f0b9d43ee36 - std[c0c5954477cb1558]::sys_common::backtrace::__rust_end_short_backtrace::<std[c0c5954477cb1558]::panicking::begin_panic<rustc_errors[489c792d0b298f43]::ExplicitBug>::{closure#0}, !>
  16:     0x7f0b9d493946 - std[c0c5954477cb1558]::panicking::begin_panic::<rustc_errors[489c792d0b298f43]::ExplicitBug>
  17:     0x7f0b9d3bf864 - <rustc_errors[489c792d0b298f43]::HandlerInner>::bug::<alloc[23fe904eb05f20cb]::string::String>
  18:     0x7f0b9d3bf716 - <rustc_errors[489c792d0b298f43]::Handler>::bug::<alloc[23fe904eb05f20cb]::string::String>
  19:     0x7f0b9d4ab91c - rustc_middle[7958b76fb19d6f0b]::util::bug::opt_span_bug_fmt::<rustc_span[68f8f0eb89050f8d]::span_encoding::Span>::{closure#0}
  20:     0x7f0b9d4a893a - rustc_middle[7958b76fb19d6f0b]::ty::context::tls::with_opt::<rustc_middle[7958b76fb19d6f0b]::util::bug::opt_span_bug_fmt<rustc_span[68f8f0eb89050f8d]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f0b9d4a8908 - rustc_middle[7958b76fb19d6f0b]::ty::context::tls::with_context_opt::<rustc_middle[7958b76fb19d6f0b]::ty::context::tls::with_opt<rustc_middle[7958b76fb19d6f0b]::util::bug::opt_span_bug_fmt<rustc_span[68f8f0eb89050f8d]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f0b9bb0daa0 - rustc_middle[7958b76fb19d6f0b]::util::bug::bug_fmt
  23:     0x7f0b9bae0264 - <rustc_mir_build[88908c2204838440]::build::Builder>::prefix_slice_suffix
  24:     0x7f0b9badada4 - <rustc_mir_build[88908c2204838440]::build::Builder>::match_candidates
  25:     0x7f0b9b536837 - <rustc_mir_build[88908c2204838440]::build::Builder>::lower_match_tree
  26:     0x7f0b9b519daf - <rustc_mir_build[88908c2204838440]::build::Builder>::expr_into_dest
  27:     0x7f0b9b51a81e - <rustc_mir_build[88908c2204838440]::build::Builder>::expr_into_dest
  28:     0x7f0b9b5464fb - <rustc_mir_build[88908c2204838440]::build::Builder>::ast_block_stmts
  29:     0x7f0b9b537068 - <rustc_mir_build[88908c2204838440]::build::Builder>::ast_block
  30:     0x7f0b9b518994 - <rustc_mir_build[88908c2204838440]::build::Builder>::expr_into_dest
  31:     0x7f0b9b51a81e - <rustc_mir_build[88908c2204838440]::build::Builder>::expr_into_dest
  32:     0x7f0b9b51a81e - <rustc_mir_build[88908c2204838440]::build::Builder>::expr_into_dest
  33:     0x7f0b9bdbb652 - rustc_mir_build[88908c2204838440]::build::mir_built
  34:     0x7f0b9b03b6dc - rustc_query_impl[2e6f533721484891]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2e6f533721484891]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>
  35:     0x7f0b9b03b6be - <rustc_query_impl[2e6f533721484891]::query_impl::mir_built::dynamic_query::{closure#2} as core[bfabaa7acdfc93fd]::ops::function::FnOnce<(rustc_middle[7958b76fb19d6f0b]::ty::context::TyCtxt, rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId)>>::call_once
  36:     0x7f0b9b11d088 - rustc_query_system[d166d5e4d4b6d975]::query::plumbing::try_execute_query::<rustc_query_impl[2e6f533721484891]::DynamicConfig<rustc_query_system[d166d5e4d4b6d975]::query::caches::VecCache<rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[2e6f533721484891]::plumbing::QueryCtxt, false>
  37:     0x7f0b9c855201 - rustc_query_impl[2e6f533721484891]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  38:     0x7f0b9c0e16b9 - rustc_mir_transform[69f845bc3665250d]::check_unsafety::unsafety_check_result
  39:     0x7f0b9b03b71c - rustc_query_impl[2e6f533721484891]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2e6f533721484891]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>
  40:     0x7f0b9b03b6fe - <rustc_query_impl[2e6f533721484891]::query_impl::unsafety_check_result::dynamic_query::{closure#2} as core[bfabaa7acdfc93fd]::ops::function::FnOnce<(rustc_middle[7958b76fb19d6f0b]::ty::context::TyCtxt, rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId)>>::call_once
  41:     0x7f0b9b11d088 - rustc_query_system[d166d5e4d4b6d975]::query::plumbing::try_execute_query::<rustc_query_impl[2e6f533721484891]::DynamicConfig<rustc_query_system[d166d5e4d4b6d975]::query::caches::VecCache<rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[2e6f533721484891]::plumbing::QueryCtxt, false>
  42:     0x7f0b9c85bce1 - rustc_query_impl[2e6f533721484891]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  43:     0x7f0b9c0e4afd - rustc_mir_transform[69f845bc3665250d]::check_unsafety::unsafety_check_result
  44:     0x7f0b9b03b71c - rustc_query_impl[2e6f533721484891]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2e6f533721484891]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>
  45:     0x7f0b9b03b6fe - <rustc_query_impl[2e6f533721484891]::query_impl::unsafety_check_result::dynamic_query::{closure#2} as core[bfabaa7acdfc93fd]::ops::function::FnOnce<(rustc_middle[7958b76fb19d6f0b]::ty::context::TyCtxt, rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId)>>::call_once
  46:     0x7f0b9b11d088 - rustc_query_system[d166d5e4d4b6d975]::query::plumbing::try_execute_query::<rustc_query_impl[2e6f533721484891]::DynamicConfig<rustc_query_system[d166d5e4d4b6d975]::query::caches::VecCache<rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[2e6f533721484891]::plumbing::QueryCtxt, false>
  47:     0x7f0b9c85bce1 - rustc_query_impl[2e6f533721484891]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  48:     0x7f0b9c0e4afd - rustc_mir_transform[69f845bc3665250d]::check_unsafety::unsafety_check_result
  49:     0x7f0b9b03b71c - rustc_query_impl[2e6f533721484891]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2e6f533721484891]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>
  50:     0x7f0b9b03b6fe - <rustc_query_impl[2e6f533721484891]::query_impl::unsafety_check_result::dynamic_query::{closure#2} as core[bfabaa7acdfc93fd]::ops::function::FnOnce<(rustc_middle[7958b76fb19d6f0b]::ty::context::TyCtxt, rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId)>>::call_once
  51:     0x7f0b9b11d088 - rustc_query_system[d166d5e4d4b6d975]::query::plumbing::try_execute_query::<rustc_query_impl[2e6f533721484891]::DynamicConfig<rustc_query_system[d166d5e4d4b6d975]::query::caches::VecCache<rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[2e6f533721484891]::plumbing::QueryCtxt, false>
  52:     0x7f0b9c85bce1 - rustc_query_impl[2e6f533721484891]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  53:     0x7f0b9c29603b - rustc_mir_transform[69f845bc3665250d]::mir_const
  54:     0x7f0b9b05001e - rustc_query_impl[2e6f533721484891]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2e6f533721484891]::query_impl::mir_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>
  55:     0x7f0b9b04ffee - <rustc_query_impl[2e6f533721484891]::query_impl::mir_const::dynamic_query::{closure#2} as core[bfabaa7acdfc93fd]::ops::function::FnOnce<(rustc_middle[7958b76fb19d6f0b]::ty::context::TyCtxt, rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId)>>::call_once
  56:     0x7f0b9b11d088 - rustc_query_system[d166d5e4d4b6d975]::query::plumbing::try_execute_query::<rustc_query_impl[2e6f533721484891]::DynamicConfig<rustc_query_system[d166d5e4d4b6d975]::query::caches::VecCache<rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[2e6f533721484891]::plumbing::QueryCtxt, false>
  57:     0x7f0b9c855571 - rustc_query_impl[2e6f533721484891]::query_impl::mir_const::get_query_non_incr::__rust_end_short_backtrace
  58:     0x7f0b9bc4d7d6 - rustc_mir_transform[69f845bc3665250d]::mir_promoted
  59:     0x7f0b9b018baf - rustc_query_impl[2e6f533721484891]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2e6f533721484891]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 16usize]>>
  60:     0x7f0b9b61e5c8 - rustc_query_system[d166d5e4d4b6d975]::query::plumbing::try_execute_query::<rustc_query_impl[2e6f533721484891]::DynamicConfig<rustc_query_system[d166d5e4d4b6d975]::query::caches::VecCache<rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[2e6f533721484891]::plumbing::QueryCtxt, false>
  61:     0x7f0b9c856174 - rustc_query_impl[2e6f533721484891]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  62:     0x7f0b9b793cf3 - rustc_borrowck[22ac151c06a46a93]::mir_borrowck
  63:     0x7f0b9b04ffbe - rustc_query_impl[2e6f533721484891]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2e6f533721484891]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>
  64:     0x7f0b9b04ff8e - <rustc_query_impl[2e6f533721484891]::query_impl::mir_borrowck::dynamic_query::{closure#2} as core[bfabaa7acdfc93fd]::ops::function::FnOnce<(rustc_middle[7958b76fb19d6f0b]::ty::context::TyCtxt, rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId)>>::call_once
  65:     0x7f0b9b11d088 - rustc_query_system[d166d5e4d4b6d975]::query::plumbing::try_execute_query::<rustc_query_impl[2e6f533721484891]::DynamicConfig<rustc_query_system[d166d5e4d4b6d975]::query::caches::VecCache<rustc_span[68f8f0eb89050f8d]::def_id::LocalDefId, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[2e6f533721484891]::plumbing::QueryCtxt, false>
  66:     0x7f0b9c85f991 - rustc_query_impl[2e6f533721484891]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  67:     0x7f0b9c68cfce - rustc_hir_analysis[b22507afc81669fd]::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
  68:     0x7f0b9c537c41 - rustc_query_impl[2e6f533721484891]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2e6f533721484891]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>
  69:     0x7f0b9c537c21 - <rustc_query_impl[2e6f533721484891]::query_impl::type_of_opaque::dynamic_query::{closure#2} as core[bfabaa7acdfc93fd]::ops::function::FnOnce<(rustc_middle[7958b76fb19d6f0b]::ty::context::TyCtxt, rustc_span[68f8f0eb89050f8d]::def_id::DefId)>>::call_once
  70:     0x7f0b9b046e60 - rustc_query_system[d166d5e4d4b6d975]::query::plumbing::try_execute_query::<rustc_query_impl[2e6f533721484891]::DynamicConfig<rustc_query_system[d166d5e4d4b6d975]::query::caches::DefaultCache<rustc_span[68f8f0eb89050f8d]::def_id::DefId, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[2e6f533721484891]::plumbing::QueryCtxt, false>
  71:     0x7f0b9c852862 - rustc_query_impl[2e6f533721484891]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  72:     0x7f0b9b950983 - rustc_hir_analysis[b22507afc81669fd]::collect::type_of::type_of
  73:     0x7f0b9b29964c - rustc_query_impl[2e6f533721484891]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2e6f533721484891]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>
  74:     0x7f0b9b299610 - <rustc_query_impl[2e6f533721484891]::query_impl::type_of::dynamic_query::{closure#2} as core[bfabaa7acdfc93fd]::ops::function::FnOnce<(rustc_middle[7958b76fb19d6f0b]::ty::context::TyCtxt, rustc_span[68f8f0eb89050f8d]::def_id::DefId)>>::call_once
  75:     0x7f0b9b046e60 - rustc_query_system[d166d5e4d4b6d975]::query::plumbing::try_execute_query::<rustc_query_impl[2e6f533721484891]::DynamicConfig<rustc_query_system[d166d5e4d4b6d975]::query::caches::DefaultCache<rustc_span[68f8f0eb89050f8d]::def_id::DefId, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[2e6f533721484891]::plumbing::QueryCtxt, false>
  76:     0x7f0b9c8524d1 - rustc_query_impl[2e6f533721484891]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  77:     0x7f0b9beab436 - rustc_middle[7958b76fb19d6f0b]::query::plumbing::query_get_at::<rustc_query_system[d166d5e4d4b6d975]::query::caches::DefaultCache<rustc_span[68f8f0eb89050f8d]::def_id::DefId, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 8usize]>>>
  78:     0x7f0b9bea4022 - rustc_hir_analysis[b22507afc81669fd]::check::check::check_mod_item_types
  79:     0x7f0b9bd3f1dc - rustc_query_impl[2e6f533721484891]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2e6f533721484891]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 0usize]>>
  80:     0x7f0b9bd3f1be - <rustc_query_impl[2e6f533721484891]::query_impl::check_mod_item_types::dynamic_query::{closure#2} as core[bfabaa7acdfc93fd]::ops::function::FnOnce<(rustc_middle[7958b76fb19d6f0b]::ty::context::TyCtxt, rustc_span[68f8f0eb89050f8d]::def_id::LocalModDefId)>>::call_once
  81:     0x7f0b9be8a5c8 - rustc_query_system[d166d5e4d4b6d975]::query::plumbing::try_execute_query::<rustc_query_impl[2e6f533721484891]::DynamicConfig<rustc_query_system[d166d5e4d4b6d975]::query::caches::DefaultCache<rustc_span[68f8f0eb89050f8d]::def_id::LocalModDefId, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[2e6f533721484891]::plumbing::QueryCtxt, false>
  82:     0x7f0b9c85d994 - rustc_query_impl[2e6f533721484891]::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
  83:     0x7f0b9c45022b - <rustc_session[48acfa7a3dfcb338]::session::Session>::time::<(), rustc_hir_analysis[b22507afc81669fd]::check_crate::{closure#6}>
  84:     0x7f0b9c44f9f3 - rustc_hir_analysis[b22507afc81669fd]::check_crate
  85:     0x7f0b9c44ebd2 - rustc_interface[1634da5f506e2d26]::passes::analysis
  86:     0x7f0b9c3e75ba - rustc_query_impl[2e6f533721484891]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2e6f533721484891]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 1usize]>>
  87:     0x7f0b9c3e75a9 - <rustc_query_impl[2e6f533721484891]::query_impl::analysis::dynamic_query::{closure#2} as core[bfabaa7acdfc93fd]::ops::function::FnOnce<(rustc_middle[7958b76fb19d6f0b]::ty::context::TyCtxt, ())>>::call_once
  88:     0x7f0b9c60d4a4 - rustc_query_system[d166d5e4d4b6d975]::query::plumbing::try_execute_query::<rustc_query_impl[2e6f533721484891]::DynamicConfig<rustc_query_system[d166d5e4d4b6d975]::query::caches::SingleCache<rustc_middle[7958b76fb19d6f0b]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[2e6f533721484891]::plumbing::QueryCtxt, false>
  89:     0x7f0b9c60d219 - rustc_query_impl[2e6f533721484891]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  90:     0x7f0b9c0f53c2 - <rustc_middle[7958b76fb19d6f0b]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[e02b405ddf0b953d]::run_compiler::{closure#1}::{closure#2}::{closure#6}, core[bfabaa7acdfc93fd]::result::Result<(), rustc_span[68f8f0eb89050f8d]::ErrorGuaranteed>>
  91:     0x7f0b9c0f3e41 - rustc_span[68f8f0eb89050f8d]::set_source_map::<core[bfabaa7acdfc93fd]::result::Result<(), rustc_span[68f8f0eb89050f8d]::ErrorGuaranteed>, rustc_interface[1634da5f506e2d26]::interface::run_compiler<core[bfabaa7acdfc93fd]::result::Result<(), rustc_span[68f8f0eb89050f8d]::ErrorGuaranteed>, rustc_driver_impl[e02b405ddf0b953d]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  92:     0x7f0b9c0f2b20 - std[c0c5954477cb1558]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1634da5f506e2d26]::util::run_in_thread_with_globals<rustc_interface[1634da5f506e2d26]::interface::run_compiler<core[bfabaa7acdfc93fd]::result::Result<(), rustc_span[68f8f0eb89050f8d]::ErrorGuaranteed>, rustc_driver_impl[e02b405ddf0b953d]::run_compiler::{closure#1}>::{closure#0}, core[bfabaa7acdfc93fd]::result::Result<(), rustc_span[68f8f0eb89050f8d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bfabaa7acdfc93fd]::result::Result<(), rustc_span[68f8f0eb89050f8d]::ErrorGuaranteed>>
  93:     0x7f0b9c7514ae - <<std[c0c5954477cb1558]::thread::Builder>::spawn_unchecked_<rustc_interface[1634da5f506e2d26]::util::run_in_thread_with_globals<rustc_interface[1634da5f506e2d26]::interface::run_compiler<core[bfabaa7acdfc93fd]::result::Result<(), rustc_span[68f8f0eb89050f8d]::ErrorGuaranteed>, rustc_driver_impl[e02b405ddf0b953d]::run_compiler::{closure#1}>::{closure#0}, core[bfabaa7acdfc93fd]::result::Result<(), rustc_span[68f8f0eb89050f8d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bfabaa7acdfc93fd]::result::Result<(), rustc_span[68f8f0eb89050f8d]::ErrorGuaranteed>>::{closure#1} as core[bfabaa7acdfc93fd]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  94:     0x7f0b99d722d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hade28bf3e4e4dec9
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/alloc/src/boxed.rs:2007:9
  95:     0x7f0b99d722d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4aba02607116b2de
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/alloc/src/boxed.rs:2007:9
  96:     0x7f0b99d722d5 - std::sys::unix::thread::Thread::new::thread_start::hd1c1d3c8b2ad27b1
                               at /rustc/0288f2e1955b154262e0669ec5f7bb9a4c6cf5aa/library/std/src/sys/unix/thread.rs:108:17
  97:     0x7f0b99a8c9eb - <unknown>
  98:     0x7f0b99b10dfc - <unknown>
  99:                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 attach the file at `/tmp/im/rustc-ice-2023-09-26T21:59:40.713655144Z-264566.txt` to your bug report

query stack during panic:
#0 [mir_built] building MIR for `something::{closure#0}::{closure#0}`
#1 [unsafety_check_result] unsafety-checking `something::{closure#0}::{closure#0}`
#2 [unsafety_check_result] unsafety-checking `something::{closure#0}`
#3 [unsafety_check_result] unsafety-checking `something`
#4 [mir_const] preparing `something` for borrow checking
#5 [mir_promoted] promoting constants in MIR for `something`
#6 [mir_borrowck] borrow-checking `something`
#7 [type_of_opaque] computing type of opaque `something::{opaque#0}`
#8 [type_of] computing type of `something::{opaque#0}`
#9 [check_mod_item_types] checking item types in top-level module
#10 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors; 1 warning emitted

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

@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 Sep 26, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 26, 2023
@compiler-errors compiler-errors removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 27, 2023
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2021-09-01

found 9 bors merge commits in the specified range
commit[0] 2021-08-30: Auto merge of #88466 - sexxi-goose:issue-88372, r=nikomatsakis
commit[1] 2021-08-30: Auto merge of #88369 - lcnr:cec-rename, r=oli-obk
commit[2] 2021-08-31: Auto merge of #88100 - HTG-YT:edition2021-compopt-stabilization, r=m-ou-se
commit[3] 2021-08-31: Auto merge of #88414 - Aaron1011:guess-foreign-head-span, r=estebank
commit[4] 2021-08-31: Auto merge of #88467 - sexxi-goose:issue-88431, r=nikomatsakis
commit[5] 2021-08-31: Auto merge of #88491 - RalfJung:miri, r=RalfJung
commit[6] 2021-08-31: Auto merge of #88527 - m-ou-se:rollup-az6xtc5, r=m-ou-se
commit[7] 2021-08-31: Auto merge of #88535 - m-ou-se:rollup-jeusxbo, r=m-ou-se
commit[8] 2021-08-31: Auto merge of #88506 - Mark-Simulacrum:fix-rlibs, r=ehuss

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 23, 2023
return unfixed len if pat has reported error

- Fixes rust-lang#116186
- Fixes rust-lang#113021

This issue arises due to the creation of a fixed-length pattern, as a result of the mir body corruption. The corruption taints `tcx.eval_to_allocation_raw`, causing it to return `AlreadyReported`. Consequently, this prevents `len.try_eval_target_usize` from evaluating correctly and returns `None`. Lastly, it results in the return of `[usize; min_len]`.

To rectify this issue, my approach is that to return unfixed when encountering `ErrorHandled::Reported`. Additionally, in instances of `ErrorHandled::TooGeneric`, the previous logic has been reinstated.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 23, 2023
return unfixed len if pat has reported error

- Fixes rust-lang#116186
- Fixes rust-lang#113021

This issue arises due to the creation of a fixed-length pattern, as a result of the mir body corruption. The corruption taints `tcx.eval_to_allocation_raw`, causing it to return `AlreadyReported`. Consequently, this prevents `len.try_eval_target_usize` from evaluating correctly and returns `None`. Lastly, it results in the return of `[usize; min_len]`.

To rectify this issue, my approach is that to return unfixed when encountering `ErrorHandled::Reported`. Additionally, in instances of `ErrorHandled::TooGeneric`, the previous logic has been reinstated.
@bors bors closed this as completed in 7e607e8 Oct 24, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 24, 2023
Rollup merge of rust-lang#117046 - bvanjoi:fix-116186, r=oli-obk

return unfixed len if pat has reported error

- Fixes rust-lang#116186
- Fixes rust-lang#113021

This issue arises due to the creation of a fixed-length pattern, as a result of the mir body corruption. The corruption taints `tcx.eval_to_allocation_raw`, causing it to return `AlreadyReported`. Consequently, this prevents `len.try_eval_target_usize` from evaluating correctly and returns `None`. Lastly, it results in the return of `[usize; min_len]`.

To rectify this issue, my approach is that to return unfixed when encountering `ErrorHandled::Reported`. Additionally, in instances of `ErrorHandled::TooGeneric`, the previous logic has been reinstated.
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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants