UPDATE: turns out I read the code too hastily. RawVec actually doesn't retry. The rest of the question stands, though.
Some collections support in-place growing with Allocator::grow. ~Vec (via RawVec) first attempts to grow, and if that fails, attempts to reallocate.~
~This seems reasonable to me, because the allocator may refuse to grow an allocation, if it can't do it efficiently, and RawVec tries again if growing fails.~
Should collections generally retry? If so, should we document it in the allocator trait? Arguably, it is somewhat documented by the "or if growing otherwise fails" text, but it would be nice to know that the collection should attempt to call allocate itself, if growing failed.
UPDATE: turns out I read the code too hastily. RawVec actually doesn't retry. The rest of the question stands, though.
Some collections support in-place growing with Allocator::grow. ~Vec (via RawVec) first attempts to grow, and if that fails, attempts to reallocate.~
~This seems reasonable to me, because the allocator may refuse to grow an allocation, if it can't do it efficiently, and RawVec tries again if growing fails.~
Should collections generally retry? If so, should we document it in the allocator trait? Arguably, it is somewhat documented by the "or if growing otherwise fails" text, but it would be nice to know that the collection should attempt to call allocate itself, if growing failed.