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 with integration test and generic_const_exprs interaction #131054

Closed
aikixd opened this issue Sep 30, 2024 · 3 comments
Closed

ICE with integration test and generic_const_exprs interaction #131054

aikixd opened this issue Sep 30, 2024 · 3 comments
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example F-generic_const_exprs `#![feature(generic_const_exprs)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features This issue requires the use of incomplete features. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@aikixd
Copy link

aikixd commented Sep 30, 2024

Code

https://github.com/aikixd/rustc-ice

$ cargo test -- intx

Meta

rustc --version --verbose:

info: The currently active `rustc` version is `rustc 1.83.0-nightly (7608018cb 2024-09-29)`

Error output


thread 'rustc' panicked at compiler/rustc_middle/src/ty/sty.rs:362:36:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7fd47e0d242a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h7265b42392dc0061
   1:     0x7fd47e8033e6 - core::fmt::write::h2ec550f80b7defd0
   2:     0x7fd47f9ba111 - std::io::Write::write_fmt::h36bfe942596e7c0c
   3:     0x7fd47e0d2282 - std::sys::backtrace::BacktraceLock::print::h91696b5f38231729
   4:     0x7fd47e0d47a1 - std::panicking::default_hook::{{closure}}::h9bab7dd14eb60554
   5:     0x7fd47e0d45d4 - std::panicking::default_hook::hf96ee8bd37f2a078
   6:     0x7fd47d19f65f - std[809dc50e31fb3515]::panicking::update_hook::<alloc[75acf6d1be4cd817]::boxed::Box<rustc_driver_impl[a244f68c38eb9e43]::install_ice_hook::{closure#0}>>::{closure#0}
   7:     0x7fd47e0d4eb8 - std::panicking::rust_panic_with_hook::h78f8bdf8cf52544b
   8:     0x7fd47e0d4c56 - std::panicking::begin_panic_handler::{{closure}}::hefdc3b651bce153f
   9:     0x7fd47e0d28d9 - std::sys::backtrace::__rust_end_short_backtrace::ha5a68a90f678ccff
  10:     0x7fd47e0d494c - rust_begin_unwind
  11:     0x7fd47ba25680 - core::panicking::panic_fmt::hd9bfe68a26a722b5
  12:     0x7fd47b8a526c - core::panicking::panic::h27a312871ca26547
  13:     0x7fd47c1ddc49 - core::option::unwrap_failed::h872b7f84941369ea
  14:     0x7fd4801de126 - <rustc_middle[c34f140c15df42dd]::ty::sty::ParamConst>::find_ty_from_env.cold
  15:     0x7fd47ae6dbe5 - <rustc_trait_selection[ba1af50efa3085cc]::traits::fulfill::FulfillProcessor as rustc_data_structures[c10109860c422da]::obligation_forest::ObligationProcessor>::process_obligation
  16:     0x7fd47e9ed381 - <rustc_data_structures[c10109860c422da]::obligation_forest::ObligationForest<rustc_trait_selection[ba1af50efa3085cc]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[ba1af50efa3085cc]::traits::fulfill::FulfillProcessor>
  17:     0x7fd47bacc519 - rustc_traits[bb89fd4e2d0a48a4]::codegen::codegen_select_candidate
  18:     0x7fd47ee02cb7 - rustc_query_impl[cfbbd627f49a4903]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[cfbbd627f49a4903]::query_impl::codegen_select_candidate::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 16usize]>>
  19:     0x7fd47ee02ba7 - <rustc_query_impl[cfbbd627f49a4903]::query_impl::codegen_select_candidate::dynamic_query::{closure#2} as core[35ecc2859a1cac9b]::ops::function::FnOnce<(rustc_middle[c34f140c15df42dd]::ty::context::TyCtxt, (rustc_middle[c34f140c15df42dd]::ty::ParamEnv, rustc_type_ir[34480bc390efd26e]::predicate::TraitRef<rustc_middle[c34f140c15df42dd]::ty::context::TyCtxt>))>>::call_once
  20:     0x7fd47ee02b69 - <rustc_query_system[e532be48e014ea19]::query::plumbing::execute_job_incr<rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<rustc_middle[c34f140c15df42dd]::ty::instance::InstanceKind, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt>::{closure#2}::{closure#2} as core[35ecc2859a1cac9b]::ops::function::FnOnce<((rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt, rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<rustc_middle[c34f140c15df42dd]::ty::instance::InstanceKind, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 16usize]>>, false, false, false>), rustc_middle[c34f140c15df42dd]::ty::instance::InstanceKind)>>::call_once
  21:     0x7fd47ee016b8 - rustc_query_system[e532be48e014ea19]::query::plumbing::try_execute_query::<rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<(rustc_middle[c34f140c15df42dd]::ty::ParamEnv, rustc_type_ir[34480bc390efd26e]::predicate::TraitRef<rustc_middle[c34f140c15df42dd]::ty::context::TyCtxt>), rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt, true>
  22:     0x7fd47ee007ca - rustc_query_impl[cfbbd627f49a4903]::query_impl::codegen_select_candidate::get_query_incr::__rust_end_short_backtrace
  23:     0x7fd47ba35b77 - rustc_ty_utils[4764d28d1af635ac]::instance::resolve_instance_raw
  24:     0x7fd47e9d2869 - rustc_query_impl[cfbbd627f49a4903]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[cfbbd627f49a4903]::query_impl::resolve_instance_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 32usize]>>
  25:     0x7fd47e9d0e37 - rustc_query_system[e532be48e014ea19]::query::plumbing::try_execute_query::<rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<(rustc_span[e7fc1a82842fb679]::def_id::DefId, &rustc_middle[c34f140c15df42dd]::ty::list::RawList<(), rustc_middle[c34f140c15df42dd]::ty::generic_args::GenericArg>)>, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 32usize]>>, false, false, false>, rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt, true>
  26:     0x7fd47e9cfb1f - rustc_query_impl[cfbbd627f49a4903]::query_impl::resolve_instance_raw::get_query_incr::__rust_end_short_backtrace
  27:     0x7fd47b99b32b - <rustc_middle[c34f140c15df42dd]::ty::context::TyCtxt>::const_eval_resolve
  28:     0x7fd47c227df0 - rustc_const_eval[f9151715fbab8270]::const_eval::eval_queries::eval_to_allocation_raw_provider
  29:     0x7fd47efbec36 - rustc_query_impl[cfbbd627f49a4903]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[cfbbd627f49a4903]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 24usize]>>
  30:     0x7fd47efbfc2f - <rustc_query_impl[cfbbd627f49a4903]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2} as core[35ecc2859a1cac9b]::ops::function::FnOnce<(rustc_middle[c34f140c15df42dd]::ty::context::TyCtxt, rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>)>>::call_once
  31:     0x7fd47efbfbb1 - <rustc_query_system[e532be48e014ea19]::query::plumbing::execute_job_incr<rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt>::{closure#2}::{closure#2} as core[35ecc2859a1cac9b]::ops::function::FnOnce<((rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt, rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 24usize]>>, false, false, false>), rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>)>>::call_once
  32:     0x7fd47efb7f98 - rustc_query_system[e532be48e014ea19]::query::plumbing::try_execute_query::<rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt, true>
  33:     0x7fd47efb76f6 - rustc_query_impl[cfbbd627f49a4903]::query_impl::eval_to_allocation_raw::get_query_incr::__rust_end_short_backtrace
  34:     0x7fd47efb6eed - rustc_const_eval[f9151715fbab8270]::const_eval::valtrees::eval_to_valtree
  35:     0x7fd47efb6d01 - <rustc_const_eval[f9151715fbab8270]::provide::{closure#0} as core[35ecc2859a1cac9b]::ops::function::FnOnce<(rustc_middle[c34f140c15df42dd]::ty::context::TyCtxt, rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>)>>::call_once
  36:     0x7fd47efb6cb8 - rustc_query_impl[cfbbd627f49a4903]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[cfbbd627f49a4903]::query_impl::eval_to_valtree::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 24usize]>>
  37:     0x7fd47efb6c79 - <rustc_query_impl[cfbbd627f49a4903]::query_impl::eval_to_valtree::dynamic_query::{closure#2} as core[35ecc2859a1cac9b]::ops::function::FnOnce<(rustc_middle[c34f140c15df42dd]::ty::context::TyCtxt, rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>)>>::call_once
  38:     0x7fd47efbfbb1 - <rustc_query_system[e532be48e014ea19]::query::plumbing::execute_job_incr<rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt>::{closure#2}::{closure#2} as core[35ecc2859a1cac9b]::ops::function::FnOnce<((rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt, rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 24usize]>>, false, false, false>), rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>)>>::call_once
  39:     0x7fd47efb7f98 - rustc_query_system[e532be48e014ea19]::query::plumbing::try_execute_query::<rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt, true>
  40:     0x7fd47f7fa1ca - rustc_query_impl[cfbbd627f49a4903]::query_impl::eval_to_valtree::get_query_incr::__rust_end_short_backtrace
  41:     0x7fd47f22d0f1 - rustc_middle[c34f140c15df42dd]::query::plumbing::query_get_at::<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<rustc_middle[c34f140c15df42dd]::mir::interpret::GlobalId>, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 24usize]>>>
  42:     0x7fd47f22cb6a - <rustc_middle[c34f140c15df42dd]::ty::context::TyCtxt>::const_eval_global_id_for_typeck
  43:     0x7fd47f22ba7e - <rustc_middle[c34f140c15df42dd]::ty::context::TyCtxt>::const_eval_resolve_for_typeck
  44:     0x7fd47f22b6c5 - <rustc_middle[c34f140c15df42dd]::ty::consts::Const>::normalize
  45:     0x7fd47ecbd235 - <rustc_middle[c34f140c15df42dd]::ty::Ty as rustc_type_ir[34480bc390efd26e]::fold::TypeSuperFoldable<rustc_middle[c34f140c15df42dd]::ty::context::TyCtxt>>::try_super_fold_with::<rustc_trait_selection[ba1af50efa3085cc]::traits::normalize_param_env_or_error::{closure#0}::ConstNormalizer>
  46:     0x7fd47ecc12ef - rustc_trait_selection[ba1af50efa3085cc]::traits::normalize_param_env_or_error
  47:     0x7fd47ecb847d - rustc_ty_utils[4764d28d1af635ac]::ty::param_env
  48:     0x7fd47ecb8127 - rustc_query_impl[cfbbd627f49a4903]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[cfbbd627f49a4903]::query_impl::param_env::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 8usize]>>
  49:     0x7fd47eb905e6 - rustc_query_system[e532be48e014ea19]::query::plumbing::try_execute_query::<rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefIdCache<rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt, true>
  50:     0x7fd47eb8fc18 - rustc_query_impl[cfbbd627f49a4903]::query_impl::param_env::get_query_incr::__rust_end_short_backtrace
  51:     0x7fd47ebf356c - rustc_ty_utils[4764d28d1af635ac]::abi::fn_abi_of_instance
  52:     0x7fd47ebf1b8d - rustc_query_impl[cfbbd627f49a4903]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[cfbbd627f49a4903]::query_impl::fn_abi_of_instance::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 16usize]>>
  53:     0x7fd47e95d12a - rustc_query_system[e532be48e014ea19]::query::plumbing::try_execute_query::<rustc_query_impl[cfbbd627f49a4903]::DynamicConfig<rustc_query_system[e532be48e014ea19]::query::caches::DefaultCache<rustc_middle[c34f140c15df42dd]::ty::ParamEnvAnd<(rustc_middle[c34f140c15df42dd]::ty::instance::Instance, &rustc_middle[c34f140c15df42dd]::ty::list::RawList<(), rustc_middle[c34f140c15df42dd]::ty::Ty>)>, rustc_middle[c34f140c15df42dd]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[cfbbd627f49a4903]::plumbing::QueryCtxt, true>
  54:     0x7fd47e95c5e7 - rustc_query_impl[cfbbd627f49a4903]::query_impl::fn_abi_of_instance::get_query_incr::__rust_end_short_backtrace
  55:     0x7fd47b7d9ed0 - <rustc_codegen_llvm[20f9732b825c804b]::context::CodegenCx as rustc_codegen_ssa[7fdcad415791a082]::traits::declare::PreDefineCodegenMethods>::predefine_fn
  56:     0x7fd47f5bd47f - rustc_codegen_llvm[20f9732b825c804b]::base::compile_codegen_unit::module_codegen
  57:     0x7fd47f62ff0e - <rustc_codegen_llvm[20f9732b825c804b]::LlvmCodegenBackend as rustc_codegen_ssa[7fdcad415791a082]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  58:     0x7fd47f62c68d - <rustc_codegen_llvm[20f9732b825c804b]::LlvmCodegenBackend as rustc_codegen_ssa[7fdcad415791a082]::traits::backend::CodegenBackend>::codegen_crate
  59:     0x7fd47f80dd30 - <rustc_interface[88f4b8091d2ff47d]::queries::Linker>::codegen_and_build_linker
  60:     0x7fd47f520c0b - rustc_interface[88f4b8091d2ff47d]::interface::run_compiler::<core[35ecc2859a1cac9b]::result::Result<(), rustc_span[e7fc1a82842fb679]::ErrorGuaranteed>, rustc_driver_impl[a244f68c38eb9e43]::run_compiler::{closure#0}>::{closure#1}
  61:     0x7fd47f622b10 - std[809dc50e31fb3515]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[88f4b8091d2ff47d]::util::run_in_thread_with_globals<rustc_interface[88f4b8091d2ff47d]::util::run_in_thread_pool_with_globals<rustc_interface[88f4b8091d2ff47d]::interface::run_compiler<core[35ecc2859a1cac9b]::result::Result<(), rustc_span[e7fc1a82842fb679]::ErrorGuaranteed>, rustc_driver_impl[a244f68c38eb9e43]::run_compiler::{closure#0}>::{closure#1}, core[35ecc2859a1cac9b]::result::Result<(), rustc_span[e7fc1a82842fb679]::ErrorGuaranteed>>::{closure#0}, core[35ecc2859a1cac9b]::result::Result<(), rustc_span[e7fc1a82842fb679]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[35ecc2859a1cac9b]::result::Result<(), rustc_span[e7fc1a82842fb679]::ErrorGuaranteed>>
  62:     0x7fd47f62317a - <<std[809dc50e31fb3515]::thread::Builder>::spawn_unchecked_<rustc_interface[88f4b8091d2ff47d]::util::run_in_thread_with_globals<rustc_interface[88f4b8091d2ff47d]::util::run_in_thread_pool_with_globals<rustc_interface[88f4b8091d2ff47d]::interface::run_compiler<core[35ecc2859a1cac9b]::result::Result<(), rustc_span[e7fc1a82842fb679]::ErrorGuaranteed>, rustc_driver_impl[a244f68c38eb9e43]::run_compiler::{closure#0}>::{closure#1}, core[35ecc2859a1cac9b]::result::Result<(), rustc_span[e7fc1a82842fb679]::ErrorGuaranteed>>::{closure#0}, core[35ecc2859a1cac9b]::result::Result<(), rustc_span[e7fc1a82842fb679]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[35ecc2859a1cac9b]::result::Result<(), rustc_span[e7fc1a82842fb679]::ErrorGuaranteed>>::{closure#1} as core[35ecc2859a1cac9b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  63:     0x7fd47f62356b - std::sys::pal::unix::thread::Thread::new::thread_start::h632175f9045063b0
  64:     0x7fd480bd81b7 - start_thread
  65:     0x7fd480c5a3cc - __GI___clone3
  66:                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: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/aikixd/Dev/playground/iwasm-minified/syslib/rustc-ice-2024-09-30T09_15_12-30746.txt` to your bug report

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden
Backtrace


thread 'rustc' panicked at compiler/rustc_middle/src/ty/sty.rs:362:36:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: <rustc_middle::ty::sty::ParamConst>::find_ty_from_env.cold
   5: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
   6: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
   7: rustc_traits::codegen::codegen_select_candidate
      [... omitted 3 frames ...]
   8: rustc_ty_utils::instance::resolve_instance_raw
      [... omitted 1 frame ...]
   9: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve
  10: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
      [... omitted 3 frames ...]
  11: rustc_const_eval::const_eval::valtrees::eval_to_valtree
  12: <rustc_const_eval::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>)>>::call_once
      [... omitted 3 frames ...]
  13: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  14: <rustc_middle::ty::context::TyCtxt>::const_eval_global_id_for_typeck
  15: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve_for_typeck
  16: <rustc_middle::ty::consts::Const>::normalize
  17: <rustc_middle::ty::Ty as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::try_super_fold_with::<rustc_trait_selection::traits::normalize_param_env_or_error::{closure#0}::ConstNormalizer>
  18: rustc_trait_selection::traits::normalize_param_env_or_error
  19: rustc_ty_utils::ty::param_env
      [... omitted 1 frame ...]
  20: rustc_ty_utils::abi::fn_abi_of_instance
      [... omitted 1 frame ...]
  21: <rustc_codegen_llvm::context::CodegenCx as rustc_codegen_ssa::traits::declare::PreDefineCodegenMethods>::predefine_fn
  22: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
  23: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  24: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  25: <rustc_interface::queries::Linker>::codegen_and_build_linker
  26: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/aikixd/Dev/playground/iwasm-minified/syslib/rustc-ice-2024-09-30T09_20_19-32028.txt` to your bug report

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [codegen_select_candidate] computing candidate for `<syslib::types::uintx::IntX<N, syslib::types::uintx::LE> as syslib::abi::Encodable>`
#1 [resolve_instance_raw] resolving instance `<syslib::types::uintx::IntX<N, syslib::types::uintx::LE> as syslib::abi::Encodable>::ENCODED_SLOTS_FIT_BYTES`
#2 [eval_to_allocation_raw] const-evaluating + checking `syslib::abi::overlay::<impl syslib::abi::Encodable for syslib::types::uintx::IntX<N, syslib::types::uintx::LE>>::encode::{constant#0}`
#3 [eval_to_valtree] evaluating type-level constant
#4 [param_env] computing normalized predicates of `syslib::abi::overlay::<impl syslib::abi::Encodable for syslib::types::uintx::IntX<N, syslib::types::uintx::LE>>::encode`
#5 [fn_abi_of_instance] computing call ABI of `syslib::abi::overlay::<impl syslib::abi::Encodable for syslib::types::uintx::IntX<32, syslib::types::uintx::LE>>::encode`
end of query stack
warning: `syslib` (test "abi_encode") generated 1 warning
error: could not compile `syslib` (test "abi_encode"); 1 warning emitted

Caused by:
  process didn't exit successfully: `/home/aikixd/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name abi_encode --edition=2021 tests/abi_encode.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=284 --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values())' -C metadata=67666a9237053461 -C extra-filename=-67666a9237053461 --out-dir /home/aikixd/Dev/playground/iwasm-minified/syslib/target/debug/deps -C incremental=/home/aikixd/Dev/playground/iwasm-minified/syslib/target/debug/incremental -L dependency=/home/aikixd/Dev/playground/iwasm-minified/syslib/target/debug/deps --extern syslib=/home/aikixd/Dev/playground/iwasm-minified/syslib/target/debug/deps/libsyslib-e275517b41e870a5.rlib` (exit status: 101)

@aikixd aikixd 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 Sep 30, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 30, 2024
@jieyouxu jieyouxu added E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example F-generic_const_exprs `#![feature(generic_const_exprs)]` requires-incomplete-features This issue requires the use of incomplete features. labels Sep 30, 2024
@cyrgani
Copy link
Contributor

cyrgani commented Sep 30, 2024

Reduced:

#![feature(generic_const_exprs)]
impl<const N: usize> Encodable for IntX<N> {
    const E: usize = 32;
    fn encode()
    where
        [(); Self::E]:,
    {
    }
}

pub trait Encodable {
    const E: usize;

    fn encode()
    where
        [(); Self::E]:;
}

pub struct IntX<const N: usize>;

and main.rs:

use syslib::{Encodable, IntX};

fn main() {
    IntX::<32>::encode();
}

This looks a lot like a duplicate of #128525.

@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 9, 2024
@workingjubilee
Copy link
Member

seems correct, closing as duplicate.

@workingjubilee workingjubilee closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2024
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-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example F-generic_const_exprs `#![feature(generic_const_exprs)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features This issue requires the use of incomplete features. 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

6 participants