-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
VecDeque::new allocates #68990
Copy link
Copy link
Closed
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I've noticed that
VecDeque::newallocates. We don't guarantee that it doesn't, but this felt inconsistent with, e.g.,Vec::new, for which we do guarantee that it does not allocate.I'm not sure what the appropriate venue is for discussing this, but I think it would make sense to remove the surprise here and guarantee that
VecDeque::newdoes not heap-allocate either.cc @rust-lang/libs