Skip to content

ICE while compiling chrono v0.4.42 (rust 1.91.0, aarch64-apple-darwin) in PyO3 CI #148787

@bazaah

Description

@bazaah

While running a CI check for pyo3 I encountered an ICE during the compilation of chrono v0.4.42 (as of today the most recent version, released 2025-11-08).

Unfortunately, it did not reproduce on a subsequent run and I do not have access to a M1 mac to try a repro myself.

Link to the CI run: https://github.com/PyO3/pyo3/actions/runs/19233273660/job/54976905090?pr=5600
Link to the PR: PyO3/pyo3#5600

Code

From the error message it appears to be flagging: https://github.com/chronotope/chrono/blob/v0.4.42/src/format/mod.rs#L440 as the culprit, but I don't see anything that looks strange -- pretty standard Display impl.

Meta

rustc --version --verbose:

rustc 1.91.0 (f8297e351 2025-10-28) running on aarch64-apple-darwin

Error output

    Downloading crates ...
    Downloaded inventory v0.3.21
     Compiling num-traits v0.2.19
     Compiling pyo3-macros-backend v0.27.1 (/Users/runner/work/pyo3/pyo3/pyo3-macros-backend)
     Compiling futures-macro v0.3.31
     Compiling powerfmt v0.2.0
     Compiling deranged v0.5.5
     Compiling num-integer v0.1.46
     Compiling futures-util v0.3.31
     Compiling num-bigint v0.4.6
     Compiling chrono v0.4.42
  error: internal compiler error: compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:777:17: `resolve_ty_and_res_fully_qualified_call` called on `LangItem`
  
  
  thread 'rustc' (25471) panicked at compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:777:17:
  Box<dyn Any>
  stack backtrace:
     0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
     1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
     2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
     3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
     4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
     5: rustc_middle::util::bug::bug_fmt
     6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::resolve_ty_and_res_fully_qualified_call
     7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_path
     8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
     9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
    10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
    11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
    12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
    13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
    14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_block
    15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
    16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_or_body_tail
    17: rustc_hir_typeck::check::check_fn
    18: rustc_hir_typeck::typeck_with_inspect::{closure#0}
    19: rustc_hir_typeck::typeck
        [... omitted 1 frame ...]
    20: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis::check_crate::{closure#2}>::{closure#0}
    21: rustc_hir_analysis::check_crate
    22: rustc_interface::passes::run_required_analyses
    23: rustc_interface::passes::analysis
        [... omitted 1 frame ...]
    24: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
    25: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
  
  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.91.0 (f8297e351 2025-10-28) running on aarch64-apple-darwin
  
  note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C instrument-coverage
  
  note: some of the compiler flags provided by cargo are hidden
  
  query stack during panic:
  #0 [typeck] type-checking `format::<impl at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/chrono-0.4.42/src/format/mod.rs:440:1: 440:33>::fmt`
  #1 [analysis] running analysis passes on this crate
  end of query stack
  error: could not compile `chrono` (lib)
  
  Caused by:
    process didn't exit successfully: `/Users/runner/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc --crate-name chrono --edition=2021 /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/chrono-0.4.42/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked --cfg 'feature="alloc"' --cfg 'feature="clock"' --cfg 'feature="default"' --cfg 'feature="iana-time-zone"' --cfg 'feature="js-sys"' --cfg 'feature="now"' --cfg 'feature="oldtime"' --cfg 'feature="std"' --cfg 'feature="wasm-bindgen"' --cfg 'feature="wasmbind"' --cfg 'feature="winapi"' --cfg 'feature="windows-link"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("__internal_bench", "alloc", "arbitrary", "clock", "core-error", "default", "iana-time-zone", "js-sys", "libc", "now", "oldtime", "pure-rust-locales", "rkyv", "rkyv-16", "rkyv-32", "rkyv-64", "rkyv-validation", "serde", "std", "unstable-locales", "wasm-bindgen", "wasmbind", "winapi", "windows-link"))' -C metadata=14617557e63268e7 -C extra-filename=-6f02c6b18fbe2f82 --out-dir /Users/runner/work/pyo3/pyo3/target/debug/deps -L dependency=/Users/runner/work/pyo3/pyo3/target/debug/deps --extern iana_time_zone=/Users/runner/work/pyo3/pyo3/target/debug/deps/libiana_time_zone-070d0469aec9e5bf.rmeta --extern num_traits=/Users/runner/work/pyo3/pyo3/target/debug/deps/libnum_traits-bb07c46e913e57f7.rmeta --cap-lints allow -D warnings -C instrument-coverage --cfg=coverage --cfg=trybuild_no_target` (exit status: 101)
  warning: build failed, waiting for other jobs to finish...
Backtrace

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions