style: rename alloc to allocator - #642
Closed
Denimworld12 wants to merge 0 commit into
Closed
Denimworld12 wants to merge 0 commit into
Denimworld12 wants to merge 0 commit into
Conversation
alejandro-vaz
self-requested a review
September 20, 2026 13:35
alejandro-vaz
left a comment
Collaborator
There was a problem hiding this comment.
looks good but I'd want #637 merged first which is going to change a bunch of this
Collaborator
|
I'm drafting the PR just to mentally mark it as blocked |
alejandro-vaz
marked this pull request as draft
September 20, 2026 13:57
alejandro-vaz
marked this pull request as ready for review
September 21, 2026 15:21
Collaborator
|
I think I fucked it up when merging |
Contributor
Author
|
@alejandro-vaz Do you want me to rebase it onto the current v2 and resolve the conflicts? |
Collaborator
|
yeah do it, more conflicts have appeared |
Denimworld12
force-pushed
the
rename-alloc-to-allocator
branch
from
September 21, 2026 18:29
c65d765 to
8ea4861
Compare
Collaborator
|
what happened?? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #640.
Renamed the identifier everywhere it appears:
RawSmallVec::allocatorandDropDealloc::allocatorfieldsallocatorparameters onnew,new_inline,new_heap,new_in,with_capacity_inandtry_with_capacity_inDeliberately left alone, since
allocthere is not this identifier:alloccrate —extern crate alloc,use alloc::alloc::{…},alloc::vec::Vec,alloc::alloc::handle_alloc_error, and the[dealloc]: alloc::alloc::GlobalAlloc::deallocdoc link// and we never alloc null pointer.Both fields are internal —
RawSmallVec::allocatorispub(crate)andDropDeallocis a private struct — so this isn't a public API change. Parameter names are visible in docs but don't affect callers.Checks
Run locally on stable:
cargo build— cleancargo test— 71 + 8 passcargo clippy --all-targets -- -D warnings— cleanI didn't run
cargo fmt.rustfmt.tomluses nightly-only options, so stable rustfmt reformats files across the whole repo, including ones untouched here. Instead I checked that no changed line exceedsmax_width = 100, sinceerror_on_line_overflow = trueand the rename adds four characters per occurrence.--all-featuresand--no-default-featuresneed nightly (#![feature]onspecialization/allocator_api); both fail identically onupstream/v2without this change, so I left them to CI.