fix allocator API `into_boxed_slice` and `into_vec`
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.7k
- Forks
- 216
- Avg merge
- 17h 50m
- Merged PRs (30d)
- 95
Description
#[inline] pub fn into_boxed_slice(self) -> Box<[T]> { self.into_vec().into_boxed_slice() }and also
pub fn into_vec(self) -> Vec<T> {Both are UBs.
Whoops, I thought I left all the stdlib-interacting functions only implemented for SmallVec<_, Global> (from_vec is correct).
Originally posted by @bolshoytoster in https://github.com/servo/rust-smallvec/issues/630#issuecomment-5744461318
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the into_boxed_slice and into_vec entry points and tracing how each handles non-Global allocators. Done means both APIs no longer have undefined behavior for the allocator cases covered by this issue, with the relevant tests passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100