Repository navigation
docs(vec): clarify into_boxed_slice allocation guarantee - #163882
Walentalien wants to merge 4 commits into
Conversation
|
Thanks for the pull request, and welcome! The Rust Project has assigned @Mark-Simulacrum (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. |
308f488 to
b457180
Compare
b457180 to
2b7e7cd
Compare
Signed-off-by: Walentalien <voliinyk@student.agh.edu.pl>
Signed-off-by: Walentalien <voliinyk@student.agh.edu.pl>
| /// Like [`Vec::into_boxed_slice`], this is in-place if `vec.capacity() == N` | ||
| /// and `vec.len() == N`. If the `vec.len() == N` but there is spare capacity, | ||
| /// the allocation will be either shrunk or reallocated, or deallocated if `N==0`. | ||
| /// Vectors of zero-sized types have no backing allocation to modify. |
There was a problem hiding this comment.
I don't think it makes sense to restate what into_boxed_slice's behavior is (especially not in this much detail). I would just refer to that.
cc #164258 which is also changing that language.
There was a problem hiding this comment.
Now just redirecting to into_boxed_slice for doc on behavior.
cc @xizheyin
| } | ||
| } | ||
|
|
||
| // note: test pulls in std, which causes errors here |
There was a problem hiding this comment.
Why are these comments deleted?
There was a problem hiding this comment.
Those comments used to explain the #[cfg(not(test))] attribute here.
But it's no longer there since this refactor
This is cleanup after refactor.
|
Reminder, once the PR becomes ready for a review, use |
Signed-off-by: user.email <valentynfyi@gmail.com>
|
@rustbot ready |
|
The job Click to see the possible cause of the failure (guessed by this bot)Important For more information how to resolve CI failures of this job, visit this link. |
|
CI failure is being addressed in #164929 |
LLM usage disclosure:
LLMs used for research and review.
Fixes #125941
r? @Mark-Simulacrum
@Mark-Simulacrum reviewed #137546 but that PR was closed due to inactivity, that review was taken into account while working on this contribution.