Bug 2581232 - Crate “heapless,” version 0.9.4, fails to compile in “cargo test”: invalid subrange error
Summary: Crate “heapless,” version 0.9.4, fails to compile in “cargo test”: invalid su...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: rust
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Rust SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2575977
TreeView+ depends on / blocked
 
Reported: 2026-11-22 07:07 UTC by Ben Beasley
Modified: 2026-11-24 06:42 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rust-embedded heapless issues 718 0 None open cargo test fails to compile: invalid subrange error; rustc-LLVM ERROR: Broken module found, compilation aborted! 2026-11-22 07:07:05 UTC
Github rust-lang rust issues 166416 0 None open rustc generates invalid debug info for [(); usize::MAX - 1] 2026-11-23 21:34:38 UTC
Github rust-lang rust issues 34127 0 None open "invalid subrange count" compiling `[(); 1 << 63]` with -g enabled 2026-11-24 06:42:02 UTC
Github rust-lang rust issues 90805 0 None closed "invalid subrange count" LLVM error for large array of ZST 2026-11-24 06:42:02 UTC

Description Ben Beasley 2026-11-22 07:07:05 UTC
Description of problem:

The latest release of the “heapless” crate, version 0.9.4, fails to compile in “cargo test” with an “invalid subrange error,” “rustc-LLVM ERROR: Broken module found, compilation aborted!”

I reported this upstream in https://github.com/rust-embedded/heapless/issues/718, but it seems like a potential rust or LLVM bug. It does *not* appear to be specific to very recent releases, as I was able to reproduce it all the way back to RHEL8.

Version-Release number of selected component (if applicable):

rust-1.100.0-3.fc46
rust-1.100.0-1.fc45
rust-1.99.1-2.fc44
rust-1.97.1-4.el9_9
rust-1.97.1-1.module_el8.10.0+4362+2b8bdec4

How reproducible:


Steps to Reproduce:

  $ git clone https://github.com/rust-embedded/heapless.git
  $ cd heapless
  $ cargo test

Actual results:

  invalid subrange count
  !5769 = !DISubrange(count: -2, lowerBound: 0)
  rustc-LLVM ERROR: Broken module found, compilation aborted!
  error: could not compile `heapless` (lib test)

On RHEL9/RHEL8, this is followed by the message:

  error: rustc interrupted by SIGSEGV, printing backtrace

Expected results:

Compilation succeeds and tests pass, as they did for heapless 0.9.3.

Additional info:

I bisected this to upstream commit https://github.com/rust-embedded/heapless/commit/61debf627ebfe38dfb265ba63c94f83f692396a7.


Note You need to log in before you can comment on or make changes to this bug.