Bug 2581232

Summary: Crate “heapless,” version 0.9.4, fails to compile in “cargo test”: invalid subrange error
Product: [Fedora] Fedora Reporter: Ben Beasley <code>
Component: rustAssignee: Rust SIG <rust-sig>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: amulhern, igor.raits, jchecahi, jistone, paumurph, rust-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2575977    

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.