From what I can gather from the currently proposed API design, the way the associated types are set up between the traits BuildAllocRef, DeallocRef and AllocRef it would be impossible to implement the latter two for an actual reference as in e.g. impl<'a> AllocRef for &'a CustomAllocator.
If I am not mistaken, this means that &'a CustomAllocator must also implement DeallocRef and needs an associated builder type. However, without GAT it is not possible to implement BuildAllocRef for CustomAllocator and define &'a CustomAllocator as the associated Ref type.
Is my understanding of the intended usage for these traits correct or am I wrong somehow? Furthermore, even if GAT were available and BuildAllocRef were defined as:
This would result in DeallocRef/AllocRef being impossible to implement for any owning handles (like Arc) or ZST handles, since built Ref would be required to be bound to the lifetime of the builder, at least if I understand the proposed GAT RFC correctly.
From what I can gather from the currently proposed API design, the way the associated types are set up between the traits
BuildAllocRef
,DeallocRef
andAllocRef
it would be impossible to implement the latter two for an actual reference as in e.g.impl<'a> AllocRef for &'a CustomAllocator
. If I am not mistaken, this means that&'a CustomAllocator
must also implementDeallocRef
and needs an associated builder type. However, without GAT it is not possible to implementBuildAllocRef
forCustomAllocator
and define&'a CustomAllocator
as the associatedRef
type.Is my understanding of the intended usage for these traits correct or am I wrong somehow? Furthermore, even if GAT were available and
BuildAllocRef
were defined as:This would result in
DeallocRef
/AllocRef
being impossible to implement for any owning handles (likeArc
) or ZST handles, since builtRef
would be required to be bound to the lifetime of the builder, at least if I understand the proposed GAT RFC correctly.