Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary lifetime bound on a generic type for Vec? #171

Open
zetanumbers opened this issue Jun 27, 2022 · 1 comment
Open

Unnecessary lifetime bound on a generic type for Vec? #171

zetanumbers opened this issue Jun 27, 2022 · 1 comment

Comments

@zetanumbers
Copy link
Contributor

zetanumbers commented Jun 27, 2022

pub struct Vec<'bump, T: 'bump> {

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 zetanumbers changed the title Unnecessary lifetime bound on a generic type for Vec Unnecessary lifetime bound on a generic type for Vec? Jun 27, 2022
@fitzgen
Copy link
Owner

fitzgen commented Jun 27, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants