-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
Description
It is clear that there is a need for the ability to move out of smart pointers and indexable things (DerefMove
, IndexMove
). The other frequently desired option is to IndexSet
, which would be a special-cased version for indexing in this situation:
map[key] = value
currently, this is handled via IndexMut
, but that is sub-optimal, because if the key
is not already part of the map
, the result is a panic.
Basic plan
DerefMove/IndexMove/IndexSet should layer on top of the traits we have now. One needs to be careful here because of subtle interactions with autoref and so forth.
Postponed RFCs
hawkw, dpc, chpio, tinaun, ulysseB and 57 moreschneiderfelipeflying-sheep, meoyawn, Ixrec, alexbool, nsmaciej and 18 moreschneiderfelipe, dzmitry-lahoda, orxfun, vesk4000 and TennyZhuangschneiderfelipe
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.