comments explaining why we have and don't have ManuallyDrop
This commit is contained in:
parent
901cd3a844
commit
3a1e114120
@ -175,6 +175,7 @@ pub struct BTreeMap<
|
|||||||
> {
|
> {
|
||||||
root: Option<Root<K, V>>,
|
root: Option<Root<K, V>>,
|
||||||
length: usize,
|
length: usize,
|
||||||
|
/// `ManuallyDrop` to control drop order (needs to be dropped after all the nodes).
|
||||||
pub(super) alloc: ManuallyDrop<A>,
|
pub(super) alloc: ManuallyDrop<A>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,6 +385,7 @@ pub struct IntoIter<
|
|||||||
> {
|
> {
|
||||||
range: LazyLeafRange<marker::Dying, K, V>,
|
range: LazyLeafRange<marker::Dying, K, V>,
|
||||||
length: usize,
|
length: usize,
|
||||||
|
/// The BTreeMap will outlive this IntoIter so we don't care about drop order for `alloc`.
|
||||||
alloc: A,
|
alloc: A,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1800,6 +1802,7 @@ pub struct DrainFilter<
|
|||||||
{
|
{
|
||||||
pred: F,
|
pred: F,
|
||||||
inner: DrainFilterInner<'a, K, V>,
|
inner: DrainFilterInner<'a, K, V>,
|
||||||
|
/// The BTreeMap will outlive this IntoIter so we don't care about drop order for `alloc`.
|
||||||
alloc: A,
|
alloc: A,
|
||||||
}
|
}
|
||||||
/// Most of the implementation of DrainFilter are generic over the type
|
/// Most of the implementation of DrainFilter are generic over the type
|
||||||
|
@ -56,6 +56,7 @@ pub struct VacantEntry<
|
|||||||
pub(super) handle: Option<Handle<NodeRef<marker::Mut<'a>, K, V, marker::Leaf>, marker::Edge>>,
|
pub(super) handle: Option<Handle<NodeRef<marker::Mut<'a>, K, V, marker::Leaf>, marker::Edge>>,
|
||||||
pub(super) dormant_map: DormantMutRef<'a, BTreeMap<K, V, A>>,
|
pub(super) dormant_map: DormantMutRef<'a, BTreeMap<K, V, A>>,
|
||||||
|
|
||||||
|
/// The BTreeMap will outlive this IntoIter so we don't care about drop order for `alloc`.
|
||||||
pub(super) alloc: A,
|
pub(super) alloc: A,
|
||||||
|
|
||||||
// Be invariant in `K` and `V`
|
// Be invariant in `K` and `V`
|
||||||
@ -81,6 +82,7 @@ pub struct OccupiedEntry<
|
|||||||
pub(super) handle: Handle<NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal>, marker::KV>,
|
pub(super) handle: Handle<NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal>, marker::KV>,
|
||||||
pub(super) dormant_map: DormantMutRef<'a, BTreeMap<K, V, A>>,
|
pub(super) dormant_map: DormantMutRef<'a, BTreeMap<K, V, A>>,
|
||||||
|
|
||||||
|
/// The BTreeMap will outlive this IntoIter so we don't care about drop order for `alloc`.
|
||||||
pub(super) alloc: A,
|
pub(super) alloc: A,
|
||||||
|
|
||||||
// Be invariant in `K` and `V`
|
// Be invariant in `K` and `V`
|
||||||
|
@ -1285,6 +1285,7 @@ pub struct DrainFilter<
|
|||||||
{
|
{
|
||||||
pred: F,
|
pred: F,
|
||||||
inner: super::map::DrainFilterInner<'a, T, ()>,
|
inner: super::map::DrainFilterInner<'a, T, ()>,
|
||||||
|
/// The BTreeMap will outlive this IntoIter so we don't care about drop order for `alloc`.
|
||||||
alloc: A,
|
alloc: A,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user