Skip to content

Fix grow_and_insert overflow regression test abort - #147

Merged
jrraymond merged 1 commit into
masterfrom
fix/grow-and-insert-capacity-overflow
Nov 8, 2026
Merged

jrraymond merged 1 commit into
masterfrom
fix/grow-and-insert-capacity-overflow

Conversation

@jrraymond

Copy link
Copy Markdown
Collaborator

Passing usize::MAX to grow_and_insert currently attempts an allocation of roughly 2 exabytes and aborts the regression test process. Use checked addition to reject the unrepresentable length before allocating or reaching the unchecked write.

Update the regression test to expect the explicit capacity-overflow panic in debug and release builds, and document the panic condition.

Validation:

  • cargo test --all-features
  • cargo test --release --all-features
  • cargo test --no-default-features --tests --lib
  • cargo fmt --all --check
  • cargo clippy -- -D warnings
  • Direct library compilation with Rust 1.56.0

An additional cargo clippy --all-features -- -D warnings check reports pre-existing redundant static lifetime warnings in src/serde_impl.rs.

@jrraymond
jrraymond merged commit 4fa671f into master Nov 8, 2026
3 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant