Skip to content

fix(classifiers): sha2 0.11 breaks {:x} formatting — finalize() return type no longer implements LowerHex #2401

@bug-ops

Description

@bug-ops

Problem

Uncommitted dep bump sha2 = \"0.10\" → \"0.11\" in Cargo.toml breaks --features full compilation:

error[E0277]: the trait bound `Array<u8, ...>: LowerHex` is not satisfied
  --> crates/zeph-llm/src/classifier/mod.rs:114:36

In sha2 0.11, Digest::finalize() returns Array<u8, N> from the hybrid-array crate (replacing GenericArray from generic-array). hybrid-array::Array does not implement LowerHex, breaking format!(\"{:x}\", hasher.finalize()).

Affected line

crates/zeph-llm/src/classifier/mod.rs:114:

let computed = format!("{:x}", hasher.finalize());  // BROKEN in sha2 0.11

Fix

Replace with hex encoding that works in sha2 0.11:

let computed = hex::encode(hasher.finalize());

Or iterate manually:

let computed = hasher.finalize().iter().map(|b| format!("{b:02x}")).collect::<String>();

Note: hex crate is already a workspace dep. Alternatively, keep sha2 = "0.10" until the formatter is fixed.

Other uncommitted dep bumps (same working tree)

These also exist in the working directory (Cargo.toml only, uncommitted) and need validation before committing:

  • ordered-float 5.1 → 5.3
  • proptest 1.10 → 1.11
  • toml 1.0 → 1.1
  • uuid 1.22 → 1.23

Only sha2 0.11 is confirmed breaking. The others are unverified.

Workaround

Revert sha2 = "0.11" to sha2 = "0.10" in Cargo.toml until the formatter is fixed.
cargo run --features full,metal (with metal feature) was NOT affected if binary was pre-built before the Cargo.toml change landed in the working tree.

Metadata

Metadata

Assignees

Labels

P1High ROI, low complexity — do next sprintbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions