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 assertion failed: matches!(self.def_kind(ct.def), DefKind :: AnonConst) if fn has generic param #112438

Closed
matthiaskrgr opened this issue Jun 8, 2023 · 3 comments · Fixed by #112634
Assignees
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. F-inline_const_pat #![feature(inline_const_pat)] I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features This issue requires the use of incomplete features. requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Jun 8, 2023

Code

#![feature(inline_const_pat)]

fn foo<const V: usize>() {
    match 0 {
        const { 1 << 5 } | _ => {}
    }
}

fn main() {}

interestingly the code compiles as soon as I remove <const V: usize> and just make it a boring foo() {...}

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (a97c36dd2 2023-06-07)
binary: rustc
commit-hash: a97c36dd2e6f711949fc9b790476e93bd9e6d1f4
commit-date: 2023-06-07
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5

Error output

<output>
Backtrace

warning: the feature `inline_const_pat` is incomplete and may not be safe to use and/or cause compiler crashes
 --> treereduce.out:1:12
  |
1 | #![feature(inline_const_pat)]
  |            ^^^^^^^^^^^^^^^^
  |
  = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information
  = note: `#[warn(incomplete_features)]` on by default

thread 'rustc' panicked at 'assertion failed: matches!(self.def_kind(ct.def), DefKind :: AnonConst)', compiler/rustc_middle/src/mir/interpret/queries.rs:98:25
stack backtrace:
   0:     0x7f767775ab71 - trace
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f767775ab71 - trace_unsynchronized<std::sys_common::backtrace::_print_fmt::{closure_env#1}>
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f767775ab71 - _print_fmt
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f767775ab71 - fmt
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f76777bb4bf - fmt
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/core/src/fmt/rt.rs:138:9
   5:     0x7f76777bb4bf - write
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f767774dd71 - write_fmt<std::sys::unix::stdio::Stderr>
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/io/mod.rs:1713:15
   7:     0x7f767775a985 - _print
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f767775a985 - print
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f767775d647 - {closure#1}
  10:     0x7f767775d434 - default_hook
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/panicking.rs:288:9
  11:     0x7f76765cc9fb - <rustc_driver_impl[3f359aa20f2c61f0]::install_ice_hook::{closure#0} as core[f9f5fd1b7386ffed]::ops::function::FnOnce<(&core[f9f5fd1b7386ffed]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f767775dd8d - call<(&core::panic::panic_info::PanicInfo), (dyn core::ops::function::Fn<(&core::panic::panic_info::PanicInfo), Output=()> + core::marker::Send + core::marker::Sync), alloc::alloc::Global>
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/alloc/src/boxed.rs:1999:9
  13:     0x7f767775dd8d - rust_panic_with_hook
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/panicking.rs:709:13
  14:     0x7f767775dae1 - {closure#0}
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/panicking.rs:595:13
  15:     0x7f767775afa6 - __rust_end_short_backtrace<std::panicking::begin_panic_handler::{closure_env#0}, !>
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7f767775d872 - begin_panic_handler
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/panicking.rs:593:5
  17:     0x7f76777b7743 - panic_fmt
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/core/src/panicking.rs:67:14
  18:     0x7f76777b77d3 - panic
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/core/src/panicking.rs:117:5
  19:     0x7f7674cf0799 - <rustc_middle[d11dae94dae5aa4]::ty::context::TyCtxt>::const_eval_resolve_for_typeck
  20:     0x7f7674b74f0f - <rustc_mir_build[42dc4d58850e2f5e]::thir::pattern::PatCtxt>::lower_lit
  21:     0x7f7674b678a0 - <rustc_mir_build[42dc4d58850e2f5e]::thir::pattern::PatCtxt>::lower_pattern
  22:     0x7f7674b766cb - <alloc[c49a19475105f89d]::vec::Vec<alloc[c49a19475105f89d]::boxed::Box<rustc_middle[d11dae94dae5aa4]::thir::Pat>> as alloc[c49a19475105f89d]::vec::spec_from_iter::SpecFromIter<alloc[c49a19475105f89d]::boxed::Box<rustc_middle[d11dae94dae5aa4]::thir::Pat>, core[f9f5fd1b7386ffed]::iter::adapters::map::Map<core[f9f5fd1b7386ffed]::slice::iter::Iter<rustc_hir[fad95f961b4ae85c]::hir::Pat>, <rustc_mir_build[42dc4d58850e2f5e]::thir::pattern::PatCtxt>::lower_patterns::{closure#0}>>>::from_iter
  23:     0x7f7674b67e57 - <rustc_mir_build[42dc4d58850e2f5e]::thir::pattern::PatCtxt>::lower_pattern
  24:     0x7f7674b65c77 - <core[f9f5fd1b7386ffed]::iter::adapters::map::Map<core[f9f5fd1b7386ffed]::slice::iter::Iter<rustc_hir[fad95f961b4ae85c]::hir::Arm>, <rustc_mir_build[42dc4d58850e2f5e]::thir::cx::Cx>::make_mirror_unadjusted::{closure#0}::{closure#14}> as core[f9f5fd1b7386ffed]::iter::traits::iterator::Iterator>::fold::<(), core[f9f5fd1b7386ffed]::iter::traits::iterator::Iterator::for_each::call<rustc_middle[d11dae94dae5aa4]::thir::ArmId, <alloc[c49a19475105f89d]::vec::Vec<rustc_middle[d11dae94dae5aa4]::thir::ArmId>>::extend_trusted<core[f9f5fd1b7386ffed]::iter::adapters::map::Map<core[f9f5fd1b7386ffed]::slice::iter::Iter<rustc_hir[fad95f961b4ae85c]::hir::Arm>, <rustc_mir_build[42dc4d58850e2f5e]::thir::cx::Cx>::make_mirror_unadjusted::{closure#0}::{closure#14}>>::{closure#0}>::{closure#0}>
  25:     0x7f7674b65a0d - <alloc[c49a19475105f89d]::vec::Vec<rustc_middle[d11dae94dae5aa4]::thir::ArmId> as alloc[c49a19475105f89d]::vec::spec_from_iter::SpecFromIter<rustc_middle[d11dae94dae5aa4]::thir::ArmId, core[f9f5fd1b7386ffed]::iter::adapters::map::Map<core[f9f5fd1b7386ffed]::slice::iter::Iter<rustc_hir[fad95f961b4ae85c]::hir::Arm>, <rustc_mir_build[42dc4d58850e2f5e]::thir::cx::Cx>::make_mirror_unadjusted::{closure#0}::{closure#14}>>>::from_iter
  26:     0x7f7674b6b438 - <rustc_mir_build[42dc4d58850e2f5e]::thir::cx::Cx>::make_mirror_unadjusted::{closure#0}
  27:     0x7f7674b64154 - <rustc_mir_build[42dc4d58850e2f5e]::thir::cx::Cx>::mirror_expr
  28:     0x7f7674b6afea - <rustc_mir_build[42dc4d58850e2f5e]::thir::cx::Cx>::make_mirror_unadjusted::{closure#0}
  29:     0x7f7674b64154 - <rustc_mir_build[42dc4d58850e2f5e]::thir::cx::Cx>::mirror_expr
  30:     0x7f7674fe8e6d - rustc_mir_build[42dc4d58850e2f5e]::thir::cx::thir_body
  31:     0x7f767460ba51 - rustc_query_impl[84f706b35b6b9e70]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[84f706b35b6b9e70]::query_impl::thir_body::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 16usize]>>
  32:     0x7f7674e7033b - rustc_query_system[716cab2bfe503dab]::query::plumbing::try_execute_query::<rustc_query_impl[84f706b35b6b9e70]::DynamicConfig<rustc_query_system[716cab2bfe503dab]::query::caches::VecCache<rustc_span[75d82fe363844395]::def_id::LocalDefId, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[84f706b35b6b9e70]::plumbing::QueryCtxt, false>
  33:     0x7f7674e70057 - rustc_query_impl[84f706b35b6b9e70]::query_impl::thir_body::get_query_non_incr::__rust_end_short_backtrace
  34:     0x7f7675deda94 - rustc_mir_build[42dc4d58850e2f5e]::thir::pattern::check_match::check_match
  35:     0x7f76745ee0ac - rustc_query_impl[84f706b35b6b9e70]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[84f706b35b6b9e70]::query_impl::check_match::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 1usize]>>
  36:     0x7f7674d3341e - rustc_query_system[716cab2bfe503dab]::query::plumbing::try_execute_query::<rustc_query_impl[84f706b35b6b9e70]::DynamicConfig<rustc_query_system[716cab2bfe503dab]::query::caches::VecCache<rustc_span[75d82fe363844395]::def_id::LocalDefId, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[84f706b35b6b9e70]::plumbing::QueryCtxt, false>
  37:     0x7f7675f4bef4 - rustc_query_impl[84f706b35b6b9e70]::query_impl::check_match::get_query_non_incr::__rust_end_short_backtrace
  38:     0x7f767543c37d - rustc_mir_build[42dc4d58850e2f5e]::build::mir_built
  39:     0x7f767460ba9c - rustc_query_impl[84f706b35b6b9e70]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[84f706b35b6b9e70]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 8usize]>>
  40:     0x7f767460ba7e - <rustc_query_impl[84f706b35b6b9e70]::query_impl::mir_built::dynamic_query::{closure#2} as core[f9f5fd1b7386ffed]::ops::function::FnOnce<(rustc_middle[d11dae94dae5aa4]::ty::context::TyCtxt, rustc_span[75d82fe363844395]::def_id::LocalDefId)>>::call_once
  41:     0x7f76746f24cd - rustc_query_system[716cab2bfe503dab]::query::plumbing::try_execute_query::<rustc_query_impl[84f706b35b6b9e70]::DynamicConfig<rustc_query_system[716cab2bfe503dab]::query::caches::VecCache<rustc_span[75d82fe363844395]::def_id::LocalDefId, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[84f706b35b6b9e70]::plumbing::QueryCtxt, false>
  42:     0x7f7675f48f11 - rustc_query_impl[84f706b35b6b9e70]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  43:     0x7f76755df2e4 - rustc_mir_transform[4856baf7e44d39b8]::check_unsafety::unsafety_check_result
  44:     0x7f767460badc - rustc_query_impl[84f706b35b6b9e70]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[84f706b35b6b9e70]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 8usize]>>
  45:     0x7f767460babe - <rustc_query_impl[84f706b35b6b9e70]::query_impl::unsafety_check_result::dynamic_query::{closure#2} as core[f9f5fd1b7386ffed]::ops::function::FnOnce<(rustc_middle[d11dae94dae5aa4]::ty::context::TyCtxt, rustc_span[75d82fe363844395]::def_id::LocalDefId)>>::call_once
  46:     0x7f76746f24cd - rustc_query_system[716cab2bfe503dab]::query::plumbing::try_execute_query::<rustc_query_impl[84f706b35b6b9e70]::DynamicConfig<rustc_query_system[716cab2bfe503dab]::query::caches::VecCache<rustc_span[75d82fe363844395]::def_id::LocalDefId, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[84f706b35b6b9e70]::plumbing::QueryCtxt, false>
  47:     0x7f7675f4ab91 - rustc_query_impl[84f706b35b6b9e70]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  48:     0x7f767582d584 - rustc_mir_transform[4856baf7e44d39b8]::mir_const
  49:     0x7f76746238be - rustc_query_impl[84f706b35b6b9e70]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[84f706b35b6b9e70]::query_impl::mir_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 8usize]>>
  50:     0x7f767462388e - <rustc_query_impl[84f706b35b6b9e70]::query_impl::mir_const::dynamic_query::{closure#2} as core[f9f5fd1b7386ffed]::ops::function::FnOnce<(rustc_middle[d11dae94dae5aa4]::ty::context::TyCtxt, rustc_span[75d82fe363844395]::def_id::LocalDefId)>>::call_once
  51:     0x7f76746f24cd - rustc_query_system[716cab2bfe503dab]::query::plumbing::try_execute_query::<rustc_query_impl[84f706b35b6b9e70]::DynamicConfig<rustc_query_system[716cab2bfe503dab]::query::caches::VecCache<rustc_span[75d82fe363844395]::def_id::LocalDefId, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[84f706b35b6b9e70]::plumbing::QueryCtxt, false>
  52:     0x7f7675f49011 - rustc_query_impl[84f706b35b6b9e70]::query_impl::mir_const::get_query_non_incr::__rust_end_short_backtrace
  53:     0x7f767534f556 - rustc_mir_transform[4856baf7e44d39b8]::mir_promoted
  54:     0x7f76745f38bf - rustc_query_impl[84f706b35b6b9e70]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[84f706b35b6b9e70]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 16usize]>>
  55:     0x7f7674e7036a - rustc_query_system[716cab2bfe503dab]::query::plumbing::try_execute_query::<rustc_query_impl[84f706b35b6b9e70]::DynamicConfig<rustc_query_system[716cab2bfe503dab]::query::caches::VecCache<rustc_span[75d82fe363844395]::def_id::LocalDefId, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[84f706b35b6b9e70]::plumbing::QueryCtxt, false>
  56:     0x7f7675f49457 - rustc_query_impl[84f706b35b6b9e70]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  57:     0x7f76754d504c - rustc_borrowck[9b0df5aae4df6ce0]::mir_borrowck
  58:     0x7f767462385e - rustc_query_impl[84f706b35b6b9e70]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[84f706b35b6b9e70]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 8usize]>>
  59:     0x7f767462382e - <rustc_query_impl[84f706b35b6b9e70]::query_impl::mir_borrowck::dynamic_query::{closure#2} as core[f9f5fd1b7386ffed]::ops::function::FnOnce<(rustc_middle[d11dae94dae5aa4]::ty::context::TyCtxt, rustc_span[75d82fe363844395]::def_id::LocalDefId)>>::call_once
  60:     0x7f76746f24cd - rustc_query_system[716cab2bfe503dab]::query::plumbing::try_execute_query::<rustc_query_impl[84f706b35b6b9e70]::DynamicConfig<rustc_query_system[716cab2bfe503dab]::query::caches::VecCache<rustc_span[75d82fe363844395]::def_id::LocalDefId, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[84f706b35b6b9e70]::plumbing::QueryCtxt, false>
  61:     0x7f7675f4bd11 - rustc_query_impl[84f706b35b6b9e70]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  62:     0x7f7675a70f1e - rustc_data_structures[1f97a7aa4fc669e3]::sync::par_for_each_in::<&[rustc_span[75d82fe363844395]::def_id::LocalDefId], <rustc_middle[d11dae94dae5aa4]::hir::map::Map>::par_body_owners<rustc_interface[5cebeb4b37f8e7df]::passes::analysis::{closure#1}::{closure#0}>::{closure#0}>
  63:     0x7f7675a70c36 - <rustc_session[3db9de5bce4cb3b6]::session::Session>::time::<(), rustc_interface[5cebeb4b37f8e7df]::passes::analysis::{closure#1}>
  64:     0x7f7675a7081f - rustc_interface[5cebeb4b37f8e7df]::passes::analysis
  65:     0x7f7675ad798a - rustc_query_impl[84f706b35b6b9e70]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[84f706b35b6b9e70]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 1usize]>>
  66:     0x7f7675ad7979 - <rustc_query_impl[84f706b35b6b9e70]::query_impl::analysis::dynamic_query::{closure#2} as core[f9f5fd1b7386ffed]::ops::function::FnOnce<(rustc_middle[d11dae94dae5aa4]::ty::context::TyCtxt, ())>>::call_once
  67:     0x7f7675c71ad8 - rustc_query_system[716cab2bfe503dab]::query::plumbing::try_execute_query::<rustc_query_impl[84f706b35b6b9e70]::DynamicConfig<rustc_query_system[716cab2bfe503dab]::query::caches::SingleCache<rustc_middle[d11dae94dae5aa4]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[84f706b35b6b9e70]::plumbing::QueryCtxt, false>
  68:     0x7f7675c718a9 - rustc_query_impl[84f706b35b6b9e70]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  69:     0x7f7675c321f5 - <rustc_middle[d11dae94dae5aa4]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[3f359aa20f2c61f0]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>>
  70:     0x7f767588ecff - <rustc_interface[5cebeb4b37f8e7df]::interface::Compiler>::enter::<rustc_driver_impl[3f359aa20f2c61f0]::run_compiler::{closure#1}::{closure#2}, core[f9f5fd1b7386ffed]::result::Result<core[f9f5fd1b7386ffed]::option::Option<rustc_interface[5cebeb4b37f8e7df]::queries::Linker>, rustc_span[75d82fe363844395]::ErrorGuaranteed>>
  71:     0x7f767588c310 - std[72a9bdb14847565]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[5cebeb4b37f8e7df]::util::run_in_thread_pool_with_globals<rustc_interface[5cebeb4b37f8e7df]::interface::run_compiler<core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>, rustc_driver_impl[3f359aa20f2c61f0]::run_compiler::{closure#1}>::{closure#0}, core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>>
  72:     0x7f767588bab5 - <<std[72a9bdb14847565]::thread::Builder>::spawn_unchecked_<rustc_interface[5cebeb4b37f8e7df]::util::run_in_thread_pool_with_globals<rustc_interface[5cebeb4b37f8e7df]::interface::run_compiler<core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>, rustc_driver_impl[3f359aa20f2c61f0]::run_compiler::{closure#1}>::{closure#0}, core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f9f5fd1b7386ffed]::result::Result<(), rustc_span[75d82fe363844395]::ErrorGuaranteed>>::{closure#1} as core[f9f5fd1b7386ffed]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  73:     0x7f76777682b5 - call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/alloc/src/boxed.rs:1985:9
  74:     0x7f76777682b5 - call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global>
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/alloc/src/boxed.rs:1985:9
  75:     0x7f76777682b5 - thread_start
                               at /rustc/a97c36dd2e6f711949fc9b790476e93bd9e6d1f4/library/std/src/sys/unix/thread.rs:108:17
  76:     0x7f767326444b - <unknown>
  77:     0x7f76732e7e40 - <unknown>
  78:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

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 (a97c36dd2 2023-06-07) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [thir_body] building THIR for `foo`
#1 [check_match] match-checking `foo`
#2 [mir_built] building MIR for `foo`
#3 [unsafety_check_result] unsafety-checking `foo`
#4 [mir_const] preparing `foo` for borrow checking
#5 [mir_promoted] promoting constants in MIR for `foo`
#6 [mir_borrowck] borrow-checking `foo`
#7 [analysis] running analysis passes on this crate
end of query stack
warning: 1 warning emitted

@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. labels Jun 8, 2023
@Noratrieb Noratrieb added F-inline_const Inline constants (aka: const blocks, const expressions, anonymous constants) F-inline_const_pat #![feature(inline_const_pat)] requires-nightly This issue requires a nightly compiler in some way. requires-incomplete-features This issue requires the use of incomplete features. and removed F-inline_const Inline constants (aka: const blocks, const expressions, anonymous constants) labels Jun 9, 2023
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2023-06-01
Regression in 871b595

#111913 cc @oli-obk

@oli-obk
Copy link
Contributor

oli-obk commented Jun 14, 2023

just needs to check for inline const along with anon consts in

assert!(matches!(self.def_kind(ct.def), DefKind::AnonConst));

@oli-obk oli-obk added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Jun 14, 2023
@mj10021
Copy link
Contributor

mj10021 commented Jun 14, 2023

@rustbot claim

@oli-obk do you mean literally just adding | DefKind::InlineConst? Seems to fix the ICE on my end

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-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. F-inline_const_pat #![feature(inline_const_pat)] I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features This issue requires the use of incomplete features. requires-nightly This issue requires a nightly compiler in some way. 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.

4 participants