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 Const #113021

Closed
matthiaskrgr opened this issue Jun 25, 2023 · 6 comments · Fixed by #117046
Closed

ICE: expected usize, got Const #113021

matthiaskrgr opened this issue Jun 25, 2023 · 6 comments · Fixed by #117046
Labels
C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc F-generic_const_exprs `#![feature(generic_const_exprs)]` glacier ICE tracked in rust-lang/glacier. 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

#![feature(generic_const_exprs)]

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

pub fn main() {}

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (22e9fe644 2023-06-23)
binary: rustc
commit-hash: 22e9fe644ea710eec50cb0aabcae7fa8dd9fd675
commit-date: 2023-06-23
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5

Error output

error[E0670]: `async fn` is not permitted in Rust 2015
 --> 063C62043B0E0550CF8DB5A3E283C6D530D674D10E7B87DEBB6545F792710536.rs:3:5
  |
3 | pub async fn something(path: &[[usize; N_ISLANDS]; PrivateStruct]) -> usize {
  |     ^^^^^ to use `async fn`, switch to Rust 2018 or later
  |
  = help: pass `--edition 2021` to `rustc`
  = note: for more on editions, read https://doc.rust-lang.org/edition-guide

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

error[E0425]: cannot find value `PrivateStruct` in this scope
 --> 063C62043B0E0550CF8DB5A3E283C6D530D674D10E7B87DEBB6545F792710536.rs:3:52
  |
3 | pub async fn something(path: &[[usize; N_ISLANDS]; PrivateStruct]) -> 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
 --> 063C62043B0E0550CF8DB5A3E283C6D530D674D10E7B87DEBB6545F792710536.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
Backtrace

error: internal compiler error: /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/compiler/rustc_middle/src/ty/consts.rs:238:32: expected usize, got Const { ty: usize, kind: Unevaluated([], DefId(0:5 ~ 063C62043B0E0550CF8DB5A3E283C6D530D674D10E7B87DEBB6545F792710536[8e5e]::something::{constant#1})) }

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/compiler/rustc_errors/src/lib.rs:1650:9
stack backtrace:
   0:     0x7fc4ff041e31 - std::backtrace_rs::backtrace::libunwind::trace::h45c8b5b393354aaa
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fc4ff041e31 - std::backtrace_rs::backtrace::trace_unsynchronized::hc5cde6aeff03cc23
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fc4ff041e31 - std::sys_common::backtrace::_print_fmt::h86fd79bdeff6c899
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fc4ff041e31 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0f1168665e8c8865
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fc4ff0a35df - core::fmt::rt::Argument::fmt::hfed1a51422c978b7
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/core/src/fmt/rt.rs:138:9
   5:     0x7fc4ff0a35df - core::fmt::write::h4dfc2a0c62cf3fd6
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/core/src/fmt/mod.rs:1094:21
   6:     0x7fc4ff034967 - std::io::Write::write_fmt::ha45cc30dd6a81686
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/std/src/io/mod.rs:1714:15
   7:     0x7fc4ff041c45 - std::sys_common::backtrace::_print::h14294ae8d055d04e
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fc4ff041c45 - std::sys_common::backtrace::print::hf007ea148056754d
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fc4ff0449f3 - std::panicking::default_hook::{{closure}}::h12f0e86c17019fae
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/std/src/panicking.rs:269:22
  10:     0x7fc4ff044784 - std::panicking::default_hook::h3e363e70e8823128
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/std/src/panicking.rs:288:9
  11:     0x7fc4fde03eab - rustc_driver_impl[1ee18bc64acaad37]::install_ice_hook::{closure#0}
  12:     0x7fc4ff04521e - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h6345ba7ef09e0a3b
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/alloc/src/boxed.rs:2007:9
  13:     0x7fc4ff04521e - std::panicking::rust_panic_with_hook::he3112cb9ec41f5a5
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/std/src/panicking.rs:709:13
  14:     0x7fc4fe3d4581 - std[590ba7ead67831d4]::panicking::begin_panic::<rustc_errors[d1d2cf2f3224cafd]::ExplicitBug>::{closure#0}
  15:     0x7fc4fe3d1856 - std[590ba7ead67831d4]::sys_common::backtrace::__rust_end_short_backtrace::<std[590ba7ead67831d4]::panicking::begin_panic<rustc_errors[d1d2cf2f3224cafd]::ExplicitBug>::{closure#0}, !>
  16:     0x7fc4fe3c2ce6 - std[590ba7ead67831d4]::panicking::begin_panic::<rustc_errors[d1d2cf2f3224cafd]::ExplicitBug>
  17:     0x7fc4fe325a14 - <rustc_errors[d1d2cf2f3224cafd]::HandlerInner>::bug::<alloc[2c2f5c796e500044]::string::String>
  18:     0x7fc4fe325896 - <rustc_errors[d1d2cf2f3224cafd]::Handler>::bug::<alloc[2c2f5c796e500044]::string::String>
  19:     0x7fc4fe34870c - rustc_middle[aeb3147772634dcd]::util::bug::opt_span_bug_fmt::<rustc_span[8155bebf48a1eb91]::span_encoding::Span>::{closure#0}
  20:     0x7fc4fe34776a - rustc_middle[aeb3147772634dcd]::ty::context::tls::with_opt::<rustc_middle[aeb3147772634dcd]::util::bug::opt_span_bug_fmt<rustc_span[8155bebf48a1eb91]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7fc4fe34773a - rustc_middle[aeb3147772634dcd]::ty::context::tls::with_context_opt::<rustc_middle[aeb3147772634dcd]::ty::context::tls::with_opt<rustc_middle[aeb3147772634dcd]::util::bug::opt_span_bug_fmt<rustc_span[8155bebf48a1eb91]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7fc4fc1c42ad - rustc_middle[aeb3147772634dcd]::util::bug::bug_fmt
  23:     0x7fc4fcf40615 - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::prefix_slice_suffix
  24:     0x7fc4fcf44bc7 - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::simplify_candidate
  25:     0x7fc4fcf4092e - <core[db7c5f9f8e26b951]::iter::adapters::map::Map<core[db7c5f9f8e26b951]::slice::iter::Iter<alloc[2c2f5c796e500044]::boxed::Box<rustc_middle[aeb3147772634dcd]::thir::Pat>>, <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::create_or_subcandidates::{closure#0}> as core[db7c5f9f8e26b951]::iter::traits::iterator::Iterator>::fold::<(), core[db7c5f9f8e26b951]::iter::traits::iterator::Iterator::for_each::call<rustc_mir_build[c1d3f5d6f149c6f6]::build::matches::Candidate, <alloc[2c2f5c796e500044]::vec::Vec<rustc_mir_build[c1d3f5d6f149c6f6]::build::matches::Candidate>>::extend_trusted<core[db7c5f9f8e26b951]::iter::adapters::map::Map<core[db7c5f9f8e26b951]::slice::iter::Iter<alloc[2c2f5c796e500044]::boxed::Box<rustc_middle[aeb3147772634dcd]::thir::Pat>>, <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::create_or_subcandidates::{closure#0}>>::{closure#0}>::{closure#0}>
  26:     0x7fc4fcf3ff95 - <alloc[2c2f5c796e500044]::vec::Vec<rustc_mir_build[c1d3f5d6f149c6f6]::build::matches::Candidate> as alloc[2c2f5c796e500044]::vec::spec_from_iter::SpecFromIter<rustc_mir_build[c1d3f5d6f149c6f6]::build::matches::Candidate, core[db7c5f9f8e26b951]::iter::adapters::map::Map<core[db7c5f9f8e26b951]::slice::iter::Iter<alloc[2c2f5c796e500044]::boxed::Box<rustc_middle[aeb3147772634dcd]::thir::Pat>>, <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::create_or_subcandidates::{closure#0}>>>::from_iter
  27:     0x7fc4fcf3c06e - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::match_candidates
  28:     0x7fc4fc22b377 - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::lower_match_tree
  29:     0x7fc4fc208540 - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::expr_into_dest
  30:     0x7fc4fc2064eb - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::expr_into_dest
  31:     0x7fc4fc237ddc - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::ast_block_stmts
  32:     0x7fc4fc22a1d3 - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::ast_block
  33:     0x7fc4fc2073c2 - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::expr_into_dest
  34:     0x7fc4fc2064eb - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::expr_into_dest
  35:     0x7fc4fc2064eb - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::expr_into_dest
  36:     0x7fc4fc208c9d - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::expr_into_dest
  37:     0x7fc4fc2064eb - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::expr_into_dest
  38:     0x7fc4fc237ddc - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::ast_block_stmts
  39:     0x7fc4fc22a1d3 - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::ast_block
  40:     0x7fc4fc2073c2 - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::expr_into_dest
  41:     0x7fc4fc2064eb - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::expr_into_dest
  42:     0x7fc4fc2064eb - <rustc_mir_build[c1d3f5d6f149c6f6]::build::Builder>::expr_into_dest
  43:     0x7fc4fccedef5 - rustc_mir_build[c1d3f5d6f149c6f6]::build::mir_built
  44:     0x7fc4fbe32e6c - rustc_query_impl[30672f8f3d90a755]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[30672f8f3d90a755]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>
  45:     0x7fc4fbe32e4e - <rustc_query_impl[30672f8f3d90a755]::query_impl::mir_built::dynamic_query::{closure#2} as core[db7c5f9f8e26b951]::ops::function::FnOnce<(rustc_middle[aeb3147772634dcd]::ty::context::TyCtxt, rustc_span[8155bebf48a1eb91]::def_id::LocalDefId)>>::call_once
  46:     0x7fc4fbf265ad - rustc_query_system[29d9bde875297da0]::query::plumbing::try_execute_query::<rustc_query_impl[30672f8f3d90a755]::DynamicConfig<rustc_query_system[29d9bde875297da0]::query::caches::VecCache<rustc_span[8155bebf48a1eb91]::def_id::LocalDefId, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[30672f8f3d90a755]::plumbing::QueryCtxt, false>
  47:     0x7fc4fd789dc1 - rustc_query_impl[30672f8f3d90a755]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  48:     0x7fc4fcf73de4 - rustc_mir_transform[ea407ab7eecac49d]::check_unsafety::unsafety_check_result
  49:     0x7fc4fbe32eac - rustc_query_impl[30672f8f3d90a755]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[30672f8f3d90a755]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>
  50:     0x7fc4fbe32e8e - <rustc_query_impl[30672f8f3d90a755]::query_impl::unsafety_check_result::dynamic_query::{closure#2} as core[db7c5f9f8e26b951]::ops::function::FnOnce<(rustc_middle[aeb3147772634dcd]::ty::context::TyCtxt, rustc_span[8155bebf48a1eb91]::def_id::LocalDefId)>>::call_once
  51:     0x7fc4fbf265ad - rustc_query_system[29d9bde875297da0]::query::plumbing::try_execute_query::<rustc_query_impl[30672f8f3d90a755]::DynamicConfig<rustc_query_system[29d9bde875297da0]::query::caches::VecCache<rustc_span[8155bebf48a1eb91]::def_id::LocalDefId, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[30672f8f3d90a755]::plumbing::QueryCtxt, false>
  52:     0x7fc4fd784db1 - rustc_query_impl[30672f8f3d90a755]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  53:     0x7fc4fcf77394 - rustc_mir_transform[ea407ab7eecac49d]::check_unsafety::unsafety_check_result
  54:     0x7fc4fbe32eac - rustc_query_impl[30672f8f3d90a755]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[30672f8f3d90a755]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>
  55:     0x7fc4fbe32e8e - <rustc_query_impl[30672f8f3d90a755]::query_impl::unsafety_check_result::dynamic_query::{closure#2} as core[db7c5f9f8e26b951]::ops::function::FnOnce<(rustc_middle[aeb3147772634dcd]::ty::context::TyCtxt, rustc_span[8155bebf48a1eb91]::def_id::LocalDefId)>>::call_once
  56:     0x7fc4fbf265ad - rustc_query_system[29d9bde875297da0]::query::plumbing::try_execute_query::<rustc_query_impl[30672f8f3d90a755]::DynamicConfig<rustc_query_system[29d9bde875297da0]::query::caches::VecCache<rustc_span[8155bebf48a1eb91]::def_id::LocalDefId, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[30672f8f3d90a755]::plumbing::QueryCtxt, false>
  57:     0x7fc4fd784db1 - rustc_query_impl[30672f8f3d90a755]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  58:     0x7fc4fd1345e4 - rustc_mir_transform[ea407ab7eecac49d]::mir_const
  59:     0x7fc4fbe3e3ce - rustc_query_impl[30672f8f3d90a755]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[30672f8f3d90a755]::query_impl::mir_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>
  60:     0x7fc4fbe3e39e - <rustc_query_impl[30672f8f3d90a755]::query_impl::mir_const::dynamic_query::{closure#2} as core[db7c5f9f8e26b951]::ops::function::FnOnce<(rustc_middle[aeb3147772634dcd]::ty::context::TyCtxt, rustc_span[8155bebf48a1eb91]::def_id::LocalDefId)>>::call_once
  61:     0x7fc4fbf265ad - rustc_query_system[29d9bde875297da0]::query::plumbing::try_execute_query::<rustc_query_impl[30672f8f3d90a755]::DynamicConfig<rustc_query_system[29d9bde875297da0]::query::caches::VecCache<rustc_span[8155bebf48a1eb91]::def_id::LocalDefId, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[30672f8f3d90a755]::plumbing::QueryCtxt, false>
  62:     0x7fc4fd7842a1 - rustc_query_impl[30672f8f3d90a755]::query_impl::mir_const::get_query_non_incr::__rust_end_short_backtrace
  63:     0x7fc4fc01258a - rustc_mir_transform[ea407ab7eecac49d]::mir_promoted
  64:     0x7fc4fbe32f01 - rustc_query_impl[30672f8f3d90a755]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[30672f8f3d90a755]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 16usize]>>
  65:     0x7fc4fc6cc5aa - rustc_query_system[29d9bde875297da0]::query::plumbing::try_execute_query::<rustc_query_impl[30672f8f3d90a755]::DynamicConfig<rustc_query_system[29d9bde875297da0]::query::caches::VecCache<rustc_span[8155bebf48a1eb91]::def_id::LocalDefId, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[30672f8f3d90a755]::plumbing::QueryCtxt, false>
  66:     0x7fc4fd77f367 - rustc_query_impl[30672f8f3d90a755]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  67:     0x7fc4fc702a2c - rustc_borrowck[5b525c22e5b16615]::mir_borrowck
  68:     0x7fc4fbe3e42e - rustc_query_impl[30672f8f3d90a755]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[30672f8f3d90a755]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>
  69:     0x7fc4fbe3e3fe - <rustc_query_impl[30672f8f3d90a755]::query_impl::mir_borrowck::dynamic_query::{closure#2} as core[db7c5f9f8e26b951]::ops::function::FnOnce<(rustc_middle[aeb3147772634dcd]::ty::context::TyCtxt, rustc_span[8155bebf48a1eb91]::def_id::LocalDefId)>>::call_once
  70:     0x7fc4fbf265ad - rustc_query_system[29d9bde875297da0]::query::plumbing::try_execute_query::<rustc_query_impl[30672f8f3d90a755]::DynamicConfig<rustc_query_system[29d9bde875297da0]::query::caches::VecCache<rustc_span[8155bebf48a1eb91]::def_id::LocalDefId, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[30672f8f3d90a755]::plumbing::QueryCtxt, false>
  71:     0x7fc4fd7850f1 - rustc_query_impl[30672f8f3d90a755]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  72:     0x7fc4fcfa6e3e - rustc_hir_analysis[bed39c5e84d3e350]::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
  73:     0x7fc4fcfa3a04 - rustc_hir_analysis[bed39c5e84d3e350]::collect::type_of::type_of
  74:     0x7fc4fbf52a33 - rustc_query_impl[30672f8f3d90a755]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[30672f8f3d90a755]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>
  75:     0x7fc4fbf529f0 - <rustc_query_impl[30672f8f3d90a755]::query_impl::type_of::dynamic_query::{closure#2} as core[db7c5f9f8e26b951]::ops::function::FnOnce<(rustc_middle[aeb3147772634dcd]::ty::context::TyCtxt, rustc_span[8155bebf48a1eb91]::def_id::DefId)>>::call_once
  76:     0x7fc4fbe3d515 - rustc_query_system[29d9bde875297da0]::query::plumbing::try_execute_query::<rustc_query_impl[30672f8f3d90a755]::DynamicConfig<rustc_query_system[29d9bde875297da0]::query::caches::DefaultCache<rustc_span[8155bebf48a1eb91]::def_id::DefId, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[30672f8f3d90a755]::plumbing::QueryCtxt, false>
  77:     0x7fc4fd783d73 - rustc_query_impl[30672f8f3d90a755]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  78:     0x7fc4fcddad50 - rustc_middle[aeb3147772634dcd]::query::plumbing::query_get_at::<rustc_query_system[29d9bde875297da0]::query::caches::DefaultCache<rustc_span[8155bebf48a1eb91]::def_id::DefId, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 8usize]>>>
  79:     0x7fc4fcdd4ca4 - rustc_hir_analysis[bed39c5e84d3e350]::check::check::check_mod_item_types
  80:     0x7fc4fcad91fc - rustc_query_impl[30672f8f3d90a755]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[30672f8f3d90a755]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 0usize]>>
  81:     0x7fc4fcad91de - <rustc_query_impl[30672f8f3d90a755]::query_impl::check_mod_item_types::dynamic_query::{closure#2} as core[db7c5f9f8e26b951]::ops::function::FnOnce<(rustc_middle[aeb3147772634dcd]::ty::context::TyCtxt, rustc_span[8155bebf48a1eb91]::def_id::LocalDefId)>>::call_once
  82:     0x7fc4fc4f518f - rustc_query_system[29d9bde875297da0]::query::plumbing::try_execute_query::<rustc_query_impl[30672f8f3d90a755]::DynamicConfig<rustc_query_system[29d9bde875297da0]::query::caches::VecCache<rustc_span[8155bebf48a1eb91]::def_id::LocalDefId, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[30672f8f3d90a755]::plumbing::QueryCtxt, false>
  83:     0x7fc4fd76fc04 - rustc_query_impl[30672f8f3d90a755]::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
  84:     0x7fc4fd298f57 - <rustc_middle[aeb3147772634dcd]::hir::map::Map>::for_each_module::<rustc_hir_analysis[bed39c5e84d3e350]::check_crate::{closure#6}::{closure#0}>
  85:     0x7fc4fd29832d - <rustc_session[91ea302e4bbb4392]::session::Session>::time::<(), rustc_hir_analysis[bed39c5e84d3e350]::check_crate::{closure#6}>
  86:     0x7fc4fd296ff7 - rustc_hir_analysis[bed39c5e84d3e350]::check_crate
  87:     0x7fc4fd28fb6a - rustc_interface[3e44238a9783f3c8]::passes::analysis
  88:     0x7fc4fd2dc83a - rustc_query_impl[30672f8f3d90a755]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[30672f8f3d90a755]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 1usize]>>
  89:     0x7fc4fd2dc829 - <rustc_query_impl[30672f8f3d90a755]::query_impl::analysis::dynamic_query::{closure#2} as core[db7c5f9f8e26b951]::ops::function::FnOnce<(rustc_middle[aeb3147772634dcd]::ty::context::TyCtxt, ())>>::call_once
  90:     0x7fc4fd471c18 - rustc_query_system[29d9bde875297da0]::query::plumbing::try_execute_query::<rustc_query_impl[30672f8f3d90a755]::DynamicConfig<rustc_query_system[29d9bde875297da0]::query::caches::SingleCache<rustc_middle[aeb3147772634dcd]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[30672f8f3d90a755]::plumbing::QueryCtxt, false>
  91:     0x7fc4fd4719e9 - rustc_query_impl[30672f8f3d90a755]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  92:     0x7fc4fd428485 - <rustc_middle[aeb3147772634dcd]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[1ee18bc64acaad37]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[db7c5f9f8e26b951]::result::Result<(), rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>>
  93:     0x7fc4fd003f4b - <rustc_interface[3e44238a9783f3c8]::interface::Compiler>::enter::<rustc_driver_impl[1ee18bc64acaad37]::run_compiler::{closure#1}::{closure#2}, core[db7c5f9f8e26b951]::result::Result<core[db7c5f9f8e26b951]::option::Option<rustc_interface[3e44238a9783f3c8]::queries::Linker>, rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>>
  94:     0x7fc4fcfffd99 - rustc_span[8155bebf48a1eb91]::set_source_map::<core[db7c5f9f8e26b951]::result::Result<(), rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>, rustc_interface[3e44238a9783f3c8]::interface::run_compiler<core[db7c5f9f8e26b951]::result::Result<(), rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>, rustc_driver_impl[1ee18bc64acaad37]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  95:     0x7fc4fcfff8c5 - <scoped_tls[5f3106920672553]::ScopedKey<rustc_span[8155bebf48a1eb91]::SessionGlobals>>::set::<rustc_interface[3e44238a9783f3c8]::interface::run_compiler<core[db7c5f9f8e26b951]::result::Result<(), rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>, rustc_driver_impl[1ee18bc64acaad37]::run_compiler::{closure#1}>::{closure#0}, core[db7c5f9f8e26b951]::result::Result<(), rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>>
  96:     0x7fc4fcffeee6 - std[590ba7ead67831d4]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3e44238a9783f3c8]::util::run_in_thread_pool_with_globals<rustc_interface[3e44238a9783f3c8]::interface::run_compiler<core[db7c5f9f8e26b951]::result::Result<(), rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>, rustc_driver_impl[1ee18bc64acaad37]::run_compiler::{closure#1}>::{closure#0}, core[db7c5f9f8e26b951]::result::Result<(), rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[db7c5f9f8e26b951]::result::Result<(), rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>>
  97:     0x7fc4fd673945 - <<std[590ba7ead67831d4]::thread::Builder>::spawn_unchecked_<rustc_interface[3e44238a9783f3c8]::util::run_in_thread_pool_with_globals<rustc_interface[3e44238a9783f3c8]::interface::run_compiler<core[db7c5f9f8e26b951]::result::Result<(), rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>, rustc_driver_impl[1ee18bc64acaad37]::run_compiler::{closure#1}>::{closure#0}, core[db7c5f9f8e26b951]::result::Result<(), rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[db7c5f9f8e26b951]::result::Result<(), rustc_span[8155bebf48a1eb91]::ErrorGuaranteed>>::{closure#1} as core[db7c5f9f8e26b951]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  98:     0x7fc4ff04f695 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2e6f8aee19cb9bca
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/alloc/src/boxed.rs:1993:9
  99:     0x7fc4ff04f695 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4548c5cdbeb5a136
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/alloc/src/boxed.rs:1993:9
 100:     0x7fc4ff04f695 - std::sys::unix::thread::Thread::new::thread_start::h57734a91bfb8a041
                               at /rustc/22e9fe644ea710eec50cb0aabcae7fa8dd9fd675/library/std/src/sys/unix/thread.rs:108:17
 101:     0x7fc4faa9d44b - <unknown>
 102:     0x7fc4fab20e40 - <unknown>
 103:                0x0 - <unknown>

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.72.0-nightly (22e9fe644 2023-06-23) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_built] building MIR for `something::{closure#0}`
#1 [unsafety_check_result] unsafety-checking `something::{closure#0}`
#2 [unsafety_check_result] unsafety-checking `something`
#3 [mir_const] preparing `something` for borrow checking
#4 [mir_promoted] promoting constants in MIR for `something`
#5 [mir_borrowck] borrow-checking `something`
#6 [type_of] computing type of `something::{opaque#0}`
#7 [check_mod_item_types] checking item types in top-level module
#8 [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, E0670.
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 Jun 25, 2023
@BoxyUwU
Copy link
Member

BoxyUwU commented Jun 25, 2023

cc @clubby789

@clubby789
Copy link
Contributor

This also ICEs on stable with the same error, so I don't think this is related to any of my recent changes at a glance. Having a look at it though

@matthiaskrgr
Copy link
Member Author

Regression in nightly-2021-09-01
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

@clubby789
Copy link
Contributor

clubby789 commented Jun 25, 2023

update const generics feature gates

I suspect that might be a false positive bisect?

@matthiaskrgr
Copy link
Member Author

ah meh, probably, if the feature gate was renamed or something, the code with the "new" feature gate might no longer trigger the ice once needed the old feature gate -_-

@workingjubilee workingjubilee added the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Jun 26, 2023
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jul 14, 2023
@syvb
Copy link
Contributor

syvb commented Jul 15, 2023

Bisected to nightly-2022-11-27, probably caused by #99798.

cargo-bisect-rustc output
  commit[0] 2022-11-25: Auto merge of #104902 - matthiaskrgr:rollup-oo27a4u, r=matthiaskrgr
  commit[1] 2022-11-25: Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwU
  commit[2] 2022-11-26: Auto merge of #104431 - alistair23:alistair/rv64-profiler, r=Mark-Simulacrum
  commit[3] 2022-11-26: Auto merge of #104730 - petrochenkov:modchild5, r=cjgillot
  commit[4] 2022-11-26: Auto merge of #103556 - clubby789:specialize-option-partial-eq, r=scottmcm
  commit[5] 2022-11-26: Auto merge of #104935 - matthiaskrgr:rollup-nuca86l, r=matthiaskrgr
  commit[6] 2022-11-26: Auto merge of #104731 - compiler-errors:early-binder-iter-size-hint, r=cjgillot
  commit[7] 2022-11-26: Auto merge of #104945 - GuillaumeGomez:rollup-ygzbpbe, r=GuillaumeGomez

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. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc F-generic_const_exprs `#![feature(generic_const_exprs)]` glacier ICE tracked in rust-lang/glacier. 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
6 participants