# Is there a reason there's no get\_disjoint\_mut for BTreeMap?

**URL:** <https://internals.rust-lang.org/t/is-there-a-reason-theres-no-get-disjoint-mut-for-btreemap/24626>\
**Category:** libs\
**Created:** [September 27, 2026, 12:05am UTC](https://internals.rust-lang.org/t/is-there-a-reason-theres-no-get-disjoint-mut-for-btreemap/24626 "2026-09-27T00:05:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan1729](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/ryan1729/32/4770_2.png) [@Ryan1729](https://internals.rust-lang.org/u/Ryan1729)\
**Post date:** [September 27, 2026, 12:05am UTC](https://internals.rust-lang.org/t/is-there-a-reason-theres-no-get-disjoint-mut-for-btreemap/24626/1 "2026-09-27T00:05:58Z")

</div>

I ran into a case today where it would be nice to be able to get mutable references to multiple of the values stored in a `BTreeMap`. I notice that [`get_disjoint_mut ` exists on slice](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.get_disjoint_mut) and also [exists on `HashMap`](https://doc.rust-lang.org/stable/std/collections/struct.HashMap.html#method.get_disjoint_mut).

I don't know much about the specific internals of `BTreeMap`, is there a reason why a `get_disjoint_mut` cannot be easily implemented for it?

---

<div class="post-metadata">

**Author:** ![programmerjake](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/programmerjake/32/5893_2.png) [@programmerjake](https://internals.rust-lang.org/u/programmerjake)\
**Post date:** [September 27, 2026, 3:50am UTC](https://internals.rust-lang.org/t/is-there-a-reason-theres-no-get-disjoint-mut-for-btreemap/24626/2 "2026-09-27T03:50:43Z")

</div>

I'd assume the reason is more that no one got around to proposing it or implementing it yet. I see no reason it could not be implemented.

---

<div class="post-metadata">

**Author:** ![RalfJung](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/ralfjung/32/2415_2.png) [@RalfJung](https://internals.rust-lang.org/u/RalfJung)\
**Post date:** [September 27, 2026, 8:23am UTC](https://internals.rust-lang.org/t/is-there-a-reason-theres-no-get-disjoint-mut-for-btreemap/24626/3 "2026-09-27T08:23:17Z")

</div>

> [@Ryan1729](#):
>
> is there a reason why a `get_disjoint_mut` cannot be easily implemented for it?

BTreeMap is complicated so it won't be _easy_ to implement.

But it should be possible and seems useful indeed.

---

<div class="post-metadata">

**Author:** ![Ryan1729](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/ryan1729/32/4770_2.png) [@Ryan1729](https://internals.rust-lang.org/u/Ryan1729)\
**Post date:** [September 28, 2026, 3:36pm UTC](https://internals.rust-lang.org/t/is-there-a-reason-theres-no-get-disjoint-mut-for-btreemap/24626/4 "2026-09-28T15:36:16Z")

</div>

I've created this ACP proposing the `get_disjoint_mut` and `get_disjoint_unchecked_mut` methods be added to `BTreeMap`. [Add a `get_disjoint_mut` method to `BTreeMap` · Issue #896 · rust-lang/libs-team · GitHub](https://github.com/rust-lang/libs-team/issues/896)
