{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiafh7zfh4s7jm6oyvg7ya54m7vlssn3dfjtd3wwddnmsewu3u32zm",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgxkuwdcif72"
},
"path": "/t/introduce-a-way-to-construct-range-from-start-length/24073#post_21",
"publishedAt": "2026-03-13T16:46:59.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"github.com/rust-lang/rfcs",
"Extending deref/index with ownership transfer: DerefMove, IndexMove, IndexSet",
"nikomatsakis"
],
"textContent": "This could be added motivation for `IndexMove` / `IndexGet`:\n\ngithub.com/rust-lang/rfcs\n\n#### Extending deref/index with ownership transfer: DerefMove, IndexMove, IndexSet\n\nopened 11:03AM - 21 Mar 15 UTC\n\n nikomatsakis \n\nT-lang T-libs-api\n\nIt 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`)",
"title": "Introduce a way to construct Range from start + length"
}