External Publication
Visit Post

Introduce a way to construct Range from start + length

Rust Internals [Unofficial] March 13, 2026
Source

This could be added motivation for IndexMove / IndexGet:

github.com/rust-lang/rfcs

Extending deref/index with ownership transfer: DerefMove, IndexMove, IndexSet

opened 11:03AM - 21 Mar 15 UTC

nikomatsakis

T-lang T-libs-api

It is clear that there is a need for the ability to move out of smart pointers a…nd 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 - https://github.com/rust-lang/rfcs/pull/178 - https://github.com/rust-lang/rfcs/pull/159 - https://github.com/rust-lang/rfcs/pull/1129 (map[key] = value)

Discussion in the ATmosphere

Loading comments...