about summary refs log tree commit diff
path: root/tests/rustdoc/source-code-pages/check-source-code-urls-to-def.rs
diff options
context:
space:
mode:
authorSidney Cammeresi <sac@cheesecake.org>2025-09-20 16:54:51 -0700
committerSidney Cammeresi <sac@cheesecake.org>2025-09-24 18:08:32 -0700
commit137d4eaf12139af894da6c0b6fe74195d6b7b98c (patch)
tree993fa064a835b53ada0aa08401ba0c89ea1bde4c /tests/rustdoc/source-code-pages/check-source-code-urls-to-def.rs
parent1d23da6b7304d9e2a2c3dcb1b0aaa709cb9bc4ad (diff)
downloadrust-137d4eaf12139af894da6c0b6fe74195d6b7b98c.tar.gz
rust-137d4eaf12139af894da6c0b6fe74195d6b7b98c.zip
BTreeMap: Don't leak allocators when initializing nodes
Memory was allocated via `Box::leak` and thence intended to be tracked
and deallocated manually, but the allocator was also leaked, not
tracked, and never dropped.  Now it is dropped immediately.

According to my reading of the `Allocator` trait, if a copy of the
allocator remains live, then its allocations must remain live.  Since
the B-tree has a copy of the allocator that will only be dropped after
the nodes, it's safe to not store the allocator in each node (which
would be a much more intrusive change).
Diffstat (limited to 'tests/rustdoc/source-code-pages/check-source-code-urls-to-def.rs')
0 files changed, 0 insertions, 0 deletions