-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changeloggood first issueGood for newcomersGood for newcomers
Description
Describe the bug
pub fn reserve(&mut self, additional: usize)
Reserve space to at leastadditionalnew bits. Capacity will be>= self.len() + additional. New bytes are uninitialized and reading them is undefined behavior.
Other reserve methods look similar, but don't document their undefined behavior; I haven't carefully read the code on whether they actually are unsafe or not.
It seems this is letting the caller trigger undefined behavior, but is not marked as unsafe.
Their documentation should probably also be unified.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changeloggood first issueGood for newcomersGood for newcomers