Skip to content

Conversation

@clarfonthey
Copy link
Contributor

@clarfonthey clarfonthey commented Dec 3, 2025

This allows implementing get_or_insert and get_or_insert_with without accessing the internals of HashMap, which is useful for #666.


Since the merge queue is busted, I decided to incorporate the suggestion to make EntryRef use ToOwned again.

Resolves #660.

@clarfonthey clarfonthey force-pushed the entry-into-entry branch 2 times, most recently from ba2b7a9 to 6a6e760 Compare December 3, 2025 14:51
@Amanieu Amanieu added this pull request to the merge queue Dec 12, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 12, 2025
@clarfonthey clarfonthey force-pushed the entry-into-entry branch 2 times, most recently from 77e0ba8 to 245958a Compare December 13, 2025 03:36
@Amanieu Amanieu enabled auto-merge December 17, 2025 23:29
auto-merge was automatically disabled December 18, 2025 02:32

Head branch was pushed to by a user without write access

@clarfonthey clarfonthey changed the title Add hash_map::{OccupiedEntry::into_entry, VacantEntryRef::insert_entry_with_key} Add hash_map::{OccupiedEntry::into_entry, VacantEntryRef::insert_entry_with_key}, make EntryRef use ToOwned again Dec 18, 2025
@clarfonthey clarfonthey force-pushed the entry-into-entry branch 2 times, most recently from ee2b227 to a60425d Compare December 18, 2025 02:48
* Add hash_map::{OccupiedEntry::into_entry, VacantEntryRef::insert_entry_with_key}
* Make hash_map::EntryRef use ToOwned instead of From/Into
@clarfonthey
Copy link
Contributor Author

Things should now compile, and remaining references in docs to From have been replaced with ToOwned instead.

@Amanieu Amanieu added this pull request to the merge queue Dec 21, 2025
Merged via the queue into rust-lang:master with commit 9037471 Dec 21, 2025
25 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.

QQ: Why use &'b Q: Into<K> over Q: ToOwned<Owned = K> as EntryRef::insert trait bound?

2 participants