-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Tracking issue for HashMap OccupiedEntry::{replace_key, replace_entry} #44286
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
A-collectionsArea: `std::collections`Area: `std::collections`B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCI-libs-radarLibs issues that are tracked on the team's radar.Libs issues that are tracked on the team's radar.Libs-SmallLibs issues that are considered "small" or self-containedLibs issues that are considered "small" or self-containedT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]disposition-closeThis PR / issue is in PFCP or FCP with a disposition to close it.This PR / issue is in PFCP or FCP with a disposition to close it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
Activity
Metadata
Metadata
Assignees
Labels
A-collectionsArea: `std::collections`Area: `std::collections`B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCI-libs-radarLibs issues that are tracked on the team's radar.Libs issues that are tracked on the team's radar.Libs-SmallLibs issues that are considered "small" or self-containedLibs issues that are considered "small" or self-containedT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]disposition-closeThis PR / issue is in PFCP or FCP with a disposition to close it.This PR / issue is in PFCP or FCP with a disposition to close it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
At the moment the only way to replace a map entry with a new one, swallows the old key. In cases the user wants to keep the old key, the only way to do so is to first
remove_entryand to theninserta new one. This requires two map look-ups.As the Entry API aims to make operations that would otherwise require two look-ups into operations that require only one, the replacing of an entry is an obvious hole in the API.
OccupiedEntry::replace_entry) #45152