Skip to content

Conversation

@clarfonthey
Copy link
Contributor

@clarfonthey clarfonthey commented Nov 1, 2025

Finally getting back to cleaning up the raw table API, and this is one of the things I wanted to do properly.

Essentially, while InsertSlot is moderately useful to ensure that indices are used correctly, it doesn't really hold its weight as an API and also is a bit misleading: it doesn't actually contain the insertion slot (i.e. pointer), just an index to it. So, this removes the InsertSlot type and renames the relevant APIs to refer to an "insert index" instead of an "insert slot."

I mostly hastily searched for the word "slot" to reword comments as necessary, although the term "slot" to refer to an actual position in the HashTable should be unchanged. To be clear, the goal of this change is to have "slot" mean the physical location in the table, and "index" refer to the specific index to obtain that location, given a table.


Note that a future addition is to also remove the Bucket type, replacing it with usize, *mut T, or &mut MaybeUninit<T> where appropriate. However, I wanted to avoid stacking too many changes at once, so, this just starts with InsertSlot.

@clarfonthey clarfonthey changed the title Remove InsertSlot refactor: Remove InsertSlot Nov 1, 2025
@Amanieu Amanieu added this pull request to the merge queue Nov 2, 2025
Merged via the queue into rust-lang:master with commit 5fe3c0b Nov 2, 2025
25 checks passed
@clarfonthey clarfonthey deleted the yeet-insert-slot branch November 2, 2025 17:31
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.

2 participants