ICE: expected int of size 8, but got size 1 · Issue #126359 · rust-lang/rust (original) (raw)

error: internal compiler error: compiler/rustc_middle/src/ty/consts/int.rs:262:13: expected int of size 8, but got size 1

thread 'rustc' panicked at compiler/rustc_middle/src/ty/consts/int.rs:262:13:
Box<dyn Any>
stack backtrace:
   0:     0x734e9e0afae5 - std::backtrace_rs::backtrace::libunwind::trace::h6be50cef0e090531
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x734e9e0afae5 - std::backtrace_rs::backtrace::trace_unsynchronized::h84167074cb4f1713
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x734e9e0afae5 - std::sys_common::backtrace::_print_fmt::hb5cf039fd1f30b07
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x734e9e0afae5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h01adaba1565f117f
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x734e9e10077b - core::fmt::rt::Argument::fmt::h2910e36f4e21d32d
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/core/src/fmt/rt.rs:165:63
   5:     0x734e9e10077b - core::fmt::write::h6d9d2f7ff8571b34
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/core/src/fmt/mod.rs:1168:21
   6:     0x734e9e0a46bf - std::io::Write::write_fmt::hd882c0f914f56bf0
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/std/src/io/mod.rs:1835:15
   7:     0x734e9e0af8be - std::sys_common::backtrace::_print::hcc6c907dafd9aacb
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x734e9e0af8be - std::sys_common::backtrace::print::h2c716a051c9b24be
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x734e9e0b22f9 - std::panicking::default_hook::{{closure}}::he8ad829f77bd4e23
  10:     0x734e9e0b209c - std::panicking::default_hook::heb22a1402d2cff23
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/std/src/panicking.rs:292:9
  11:     0x734e9a8b2c9f - std[5c07af62f3786d14]::panicking::update_hook::<alloc[eebcfc85002bd7db]::boxed::Box<rustc_driver_impl[2b4723ede88f52b1]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x734e9e0b2bff - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>:🤙:hd8f0fcaec26c179e
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/alloc/src/boxed.rs:2076:9
  13:     0x734e9e0b2bff - std::panicking::rust_panic_with_hook::hc9dbad8884217847
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/std/src/panicking.rs:801:13
  14:     0x734e9a8e3621 - std[5c07af62f3786d14]::panicking::begin_panic::<rustc_errors[d9dad43edaa48690]::ExplicitBug>::{closure#0}
  15:     0x734e9a8e03d6 - std[5c07af62f3786d14]::sys_common::backtrace::__rust_end_short_backtrace::<std[5c07af62f3786d14]::panicking::begin_panic<rustc_errors[d9dad43edaa48690]::ExplicitBug>::{closure#0}, !>
  16:     0x734e9a8e00b6 - std[5c07af62f3786d14]::panicking::begin_panic::<rustc_errors[d9dad43edaa48690]::ExplicitBug>
  17:     0x734e9a8ecb71 - <rustc_errors[d9dad43edaa48690]::diagnostic::BugAbort as rustc_errors[d9dad43edaa48690]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  18:     0x734e9adda21c - rustc_middle[f645b954b6a941ee]::util:🐛:opt_span_bug_fmt::<rustc_span[9012e0e35e67507c]::span_encoding::Span>::{closure#0}
  19:     0x734e9adc328a - rustc_middle[f645b954b6a941ee]::ty::context::tls::with_opt::<rustc_middle[f645b954b6a941ee]::util:🐛:opt_span_bug_fmt<rustc_span[9012e0e35e67507c]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  20:     0x734e9adc310b - rustc_middle[f645b954b6a941ee]::ty::context::tls::with_context_opt::<rustc_middle[f645b954b6a941ee]::ty::context::tls::with_opt<rustc_middle[f645b954b6a941ee]::util:🐛:opt_span_bug_fmt<rustc_span[9012e0e35e67507c]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  21:     0x734e987dddb0 - rustc_middle[f645b954b6a941ee]::util:🐛:bug_fmt
  22:     0x734e9d20e0ea - <rustc_middle[f645b954b6a941ee]::ty::consts::valtree::ValTree>::try_to_target_usize.cold
  23:     0x734e9bc639b2 - <rustc_infer[fa1e69436ce00111]::infer::InferCtxt>::super_combine_tys::<rustc_infer[fa1e69436ce00111]::infer::relate::type_relating::TypeRelating>
  24:     0x734e9bc5eb28 - <rustc_infer[fa1e69436ce00111]::infer::relate::type_relating::TypeRelating as rustc_type_ir[f1d7f392dd8f0b20]::relate::TypeRelation<rustc_middle[f645b954b6a941ee]::ty::context::TyCtxt>>::tys
  25:     0x734e9c80a039 - <rustc_hir_typeck[4e714526a792ece6]::fn_ctxt::FnCtxt>::coerce
  26:     0x734e9c410955 - <rustc_hir_typeck[4e714526a792ece6]::fn_ctxt::FnCtxt>::check_expr_struct_fields
  27:     0x734e9c82a2f5 - <rustc_hir_typeck[4e714526a792ece6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  28:     0x734e9c806a1a - <rustc_hir_typeck[4e714526a792ece6]::fn_ctxt::FnCtxt>::check_decl
  29:     0x734e9c822ba5 - <rustc_hir_typeck[4e714526a792ece6]::fn_ctxt::FnCtxt>::check_block_with_expected
  30:     0x734e9c82724e - <rustc_hir_typeck[4e714526a792ece6]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  31:     0x734e9bdbabee - rustc_hir_typeck[4e714526a792ece6]::check::check_fn
  32:     0x734e9bdb13fe - rustc_hir_typeck[4e714526a792ece6]::typeck
  33:     0x734e9bdb0e7b - rustc_query_impl[860f4585269295fe]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[860f4585269295fe]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[f645b954b6a941ee]::query::erase::Erased<[u8; 8usize]>>
  34:     0x734e9beb97ee - rustc_query_system[88bb5c8529314a04]::query::plumbing::try_execute_query::<rustc_query_impl[860f4585269295fe]::DynamicConfig<rustc_query_system[88bb5c8529314a04]::query::caches::VecCache<rustc_span[9012e0e35e67507c]::def_id::LocalDefId, rustc_middle[f645b954b6a941ee]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[860f4585269295fe]::plumbing::QueryCtxt, false>
  35:     0x734e9beb82d5 - rustc_query_impl[860f4585269295fe]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  36:     0x734e9beb7f0b - <rustc_middle[f645b954b6a941ee]::hir::map::Map>::par_body_owners::<rustc_hir_analysis[f165ce28b444ebe1]::check_crate::{closure#4}>::{closure#0}
  37:     0x734e9beb69bc - rustc_hir_analysis[f165ce28b444ebe1]::check_crate
  38:     0x734e9c64f13e - rustc_interface[8465b2f8b714accd]::passes::analysis
  39:     0x734e9c64ec87 - rustc_query_impl[860f4585269295fe]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[860f4585269295fe]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[f645b954b6a941ee]::query::erase::Erased<[u8; 1usize]>>
  40:     0x734e9c9f7d25 - rustc_query_system[88bb5c8529314a04]::query::plumbing::try_execute_query::<rustc_query_impl[860f4585269295fe]::DynamicConfig<rustc_query_system[88bb5c8529314a04]::query::caches::SingleCache<rustc_middle[f645b954b6a941ee]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[860f4585269295fe]::plumbing::QueryCtxt, false>
  41:     0x734e9c9f7a8f - rustc_query_impl[860f4585269295fe]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  42:     0x734e9c8d0952 - rustc_interface[8465b2f8b714accd]::interface::run_compiler::<core[207868f0da9fe1eb]::result::Result<(), rustc_span[9012e0e35e67507c]::ErrorGuaranteed>, rustc_driver_impl[2b4723ede88f52b1]::run_compiler::{closure#0}>::{closure#1}
  43:     0x734e9c8ef649 - std[5c07af62f3786d14]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8465b2f8b714accd]::util::run_in_thread_with_globals<rustc_interface[8465b2f8b714accd]::util::run_in_thread_pool_with_globals<rustc_interface[8465b2f8b714accd]::interface::run_compiler<core[207868f0da9fe1eb]::result::Result<(), rustc_span[9012e0e35e67507c]::ErrorGuaranteed>, rustc_driver_impl[2b4723ede88f52b1]::run_compiler::{closure#0}>::{closure#1}, core[207868f0da9fe1eb]::result::Result<(), rustc_span[9012e0e35e67507c]::ErrorGuaranteed>>::{closure#0}, core[207868f0da9fe1eb]::result::Result<(), rustc_span[9012e0e35e67507c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[207868f0da9fe1eb]::result::Result<(), rustc_span[9012e0e35e67507c]::ErrorGuaranteed>>
  44:     0x734e9c8ef3fa - <<std[5c07af62f3786d14]::thread::Builder>::spawn_unchecked_<rustc_interface[8465b2f8b714accd]::util::run_in_thread_with_globals<rustc_interface[8465b2f8b714accd]::util::run_in_thread_pool_with_globals<rustc_interface[8465b2f8b714accd]::interface::run_compiler<core[207868f0da9fe1eb]::result::Result<(), rustc_span[9012e0e35e67507c]::ErrorGuaranteed>, rustc_driver_impl[2b4723ede88f52b1]::run_compiler::{closure#0}>::{closure#1}, core[207868f0da9fe1eb]::result::Result<(), rustc_span[9012e0e35e67507c]::ErrorGuaranteed>>::{closure#0}, core[207868f0da9fe1eb]::result::Result<(), rustc_span[9012e0e35e67507c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[207868f0da9fe1eb]::result::Result<(), rustc_span[9012e0e35e67507c]::ErrorGuaranteed>>::{closure#2} as core[207868f0da9fe1eb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  45:     0x734e9e0bca7b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd64233370b4bbb13
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/alloc/src/boxed.rs:2062:9
  46:     0x734e9e0bca7b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8b9a0bf226b4eb10
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/alloc/src/boxed.rs:2062:9
  47:     0x734e9e0bca7b - std::sys::pal::unix::thread::Thread:🆕:thread_start::h25e4cee516ffa27e
                               at /rustc/c25ac9d6cc285e57e1176dc2da6848b9d0163810/library/std/src/sys/pal/unix/thread.rs:108:17
  48:     0x734e974a6ded - <unknown>
  49:     0x734e9752a0dc - <unknown>
  50:                0x0 - <unknown>

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

note: please make sure that you have updated to the latest nightly

note: rustc 1.81.0-nightly (c25ac9d6c 2024-06-12) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 1 previous error