bumpalo icon indicating copy to clipboard operation
bumpalo copied to clipboard

Unnecessary lifetime bound on a generic type for `Vec`?

Open zetanumbers opened this issue 2 years ago • 1 comments

https://github.com/fitzgen/bumpalo/blob/f5e01a7b498077f181a81e2db1be2a0e8c579435/src/collections/vec.rs#L520

This lifetime bound disallows T to outlive 'bump, i.e. its allocator borrow. std::vec::Vec doesn't have anything remotely like that. Also it disallows me to add some drop check tests from std, which i am not sure if they are actually fixed or not.

EDIT: I it does fixes it, but then it should disallow types which wouldn't need a drop check.

zetanumbers avatar Jun 27 '22 19:06 zetanumbers

We should do whatever std does. When I ported Vec over, it didn't have a generic allocator yet, so it makes sense that things have diverged. We should reconverge them.

fitzgen avatar Jun 27 '22 21:06 fitzgen