Repository navigation
Conversation
53ba2b2 replaced the "2^32 - 2 elements" panic wording with "Panics if the slot map is full." in basic.rs (all three insert methods) and in dense.rs, but dense.rs's try_insert_with_key was missed. It is the function insert and insert_with_key both delegate to, so its documented panic condition must match theirs; its only panic is if self.slots.len() >= u32::MAX as usize { panic!("DenseSlotMap is full"); } which is not an element-count check. Align the wording with the two callers. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DenseSlotMap::try_insert_with_keydocuments a panic its body cannot produce — "the number of elements equals 2³² − 2". The only panic is on the slot vector length:There is no element counter in
DenseSlotMap. The two methods above it wrap this exact function and both say "Panics if the slot map is full" — same code path, contradictory docs.A missed line:
223d022added the 2³²−2 wording to all three maps,53ba2b2fixed three occurrences inbasic.rsbut only two indense.rs.HopSlotMapkeeps it, and there it is accurate.One doc line.
cargo test: 17 + 191 doctests green.If you meant Dense to have Hop's cap and the code is what is wrong, say so and I will redo it.