Skip to content

Compiler panicked at 'is_signed on non-scalar ABI' during const evaluation on windows-sys crate #138971

Open
@AqourSoro

Description

@AqourSoro

Code

The Internal Compiler Error (ICE) was triggered during compilation of the crate windows-sys version 0.59.0, as a dependency of evcxr_jupyter. Minimal reproduction command:

cargo install --locked evcxr_jupyter

Currently, this is the smallest reliable reproduction step found.

Meta

Output of rustc --version --verbose:

rustc 1.85.1 (4eb161250 2025-03-15)
binary: rustc
commit-hash: 4eb161250e340c8f48f66e2b929ef4a5bed7c181
commit-date: 2025-03-15
host: x86_64-pc-windows-msvc
release: 1.85.1
LLVM version: 18.1.3

Error output

thread 'rustc' panicked at /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181\compiler\rustc_abi\src\lib.rs:1446:18:
`is_signed` on non-scalar ABI ScalarPair(Union { value: Int(I8, false) }, Initialized { value: Int(I8, false), valid_range: 21301445860939404079836335616267649024..=105358827881679071900638810302764611136 })

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.85.1 (4eb161250 2025-03-15) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C strip=debuginfo

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `Win32::Foundation::ERROR_FLT_NO_HANDLER_DEFINED`
#1 [eval_to_const_value_raw] simplifying constant for the type system `Win32::Foundation::ERROR_FLT_NO_HANDLER_DEFINED`
end of query stack

error: could not compile `windows-sys` (lib)

Caused by:
  process didn't exit successfully: `rustc.exe --crate-name windows_sys --edition=2021 windows-sys-0.59.0\src\lib.rs --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --warn=rust_2018_idioms --warn=unexpected_cfgs --warn=missing_docs` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

error: failed to compile `evcxr_jupyter v0.19.0`, intermediate artifacts can be found at `C:\Users\97175\AppData\Local\Temp\cargo-installLYwVOH`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Backtrace

stack backtrace:
0: std::backtrace_rs::backtrace::dbghelp64::trace
1: std::backtrace_rs::backtrace::trace_unsynchronized
2: std::sys::backtrace::_print_fmt
3: std::sys::backtrace::impl$0::print::impl$0::fmt
4: core::fmt::rt::Argument::fmt
5: core::fmt::write
6: std::io::Write::write_fmt
7: std::sys::backtrace::BacktraceLock::print
8: std::panicking::default_hook::closure$1
9: std::panicking::default_hook
10: core::slice::sort::unstable::heapsort::heapsort
11: alloc::boxed::impl$30::call
12: std::panicking::rust_panic_with_hook
13: std::panicking::begin_panic_handler::closure$0
14: std::sys::backtrace::__rust_end_short_backtrace
15: std::panicking::begin_panic_handler
16: core::panicking::panic_fmt
17: rustc_const_eval::interpret::eval_context::InterpCx<_>::storage_live_dyn::is_very_trivially_sized
18: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
19: rustc_query_impl::plumbing::query_key_hash_verify_all
20: rustc_query_system::query::plumbing::try_execute_query
21: rustc_query_impl::plumbing::query_key_hash_verify_all
22: rustc_const_eval::const_eval::eval_queries::eval_to_const_value_raw_provider
23: rustc_query_impl::plumbing::query_key_hash_verify_all
24: rustc_query_system::query::plumbing::try_execute_query
25: rustc_query_impl::plumbing::query_key_hash_verify_all
26: hashbrown::raw::RawTable::reserve_rehash
27: rustc_hir_analysis::check_crate
28: rustc_interface::passes::resolver_for_lowering_raw
29: rustc_interface::passes::analysis
30: alloc::sync::Arc<rustc_session::config::OutputFilenames>::drop_slow
31: rustc_query_system::query::plumbing::try_execute_query
32: rustc_query_impl::query_system
33: rustc_interface::util::run_in_thread_with_globals
34: rustc_interface::util::run_in_thread_pool_with_globals
35: rustc_interface::interface::run_compiler
36: alloc::boxed::impl$28::call_once
37: std::sys::pal::windows::thread::impl$0::new::thread_start
38: BaseThreadInitThunk
39: RtlUserThreadStart


This issue was found while attempting to compile the evcxr_jupyter crate on Windows (x86_64-pc-windows-msvc) environment. It seems specifically related to compiling the windows-sys crate, version 0.59.0, using Rust 1.85.1. The error consistently reproduces with optimization flags enabled (-C opt-level=3) and causes the compiler to panic due to an internal error in const evaluation.

A minimized version was not yet produced given the complexity, but the reproduction above is reliable and clear.

Please let me know if any additional information or testing is required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions