So there's Box::pin_in function under allocator_api feature. This function has where clause A: 'static where A is allocator type. Making it impossible to use with allocator that is bound to non-'static lifetime.
I can't see any reason for this where clause. Can anyone explain me the motivation behind it?
As I understand, Pin<Box<T, A>> won't allow moving T out unless T is Unpin and will drop the T before A expires. So even if A expires at some point it won't allow violation of Pin, right?
No, other methods do not require A: 'static.
I was pointed out on the PR that added the bound.
Turned out the problem is that it is safe to skip Dropping of the boxed value. mem::forget and Box::leak can do that.
And memory will become invalid without Drop glue which is incorrect for Pinned value.