Add custom allocator support to (try_)map on UniqueArc and UniqueRc - #161893
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
maxdexh
force-pushed
the
unique-arc-map
branch
from
August 31, 2026 14:48
365a707 to
0e8392e
Compare
This comment has been minimized.
This comment has been minimized.
maxdexh
force-pushed
the
unique-arc-map
branch
from
September 1, 2026 17:51
0e8392e to
7791246
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
nia-e
reviewed
Sep 3, 2026
Member
There was a problem hiding this comment.
looks good impl-wise, but for parity with rc/arc i think it makes sense to keep the allocator-free methods as well with the defaulted generic.
@rustbot author
| impl<T: ?Sized> UniqueRc<T> { | ||
| impl<T: ?Sized, A: Allocator> UniqueRc<T, A> { | ||
| #[cfg(not(no_global_oom_handling))] | ||
| unsafe fn from_raw(ptr: *const T) -> Self { |
Member
There was a problem hiding this comment.
same here, these functions should probably also have A=Global impls
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
Member
|
alright, we can do the deleted methods as a later pr. this makes sense to land now in the meantime. @bors r+ |
Contributor
Member
Author
|
gotta pad my pr numbers somehow ;) |
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 3, 2026
Add custom allocator support to `(try_)map` on `UniqueArc` and `UniqueRc` Follow-up to rust-lang#161617. This one required me to add allocator support to a lot more methods. Probably good for them to have it for future additions ^^ The old, allocator-free methods went unused from this change and I had to remove them because we don't allow warnings (they are trivial to implement on top of the allocator ones). This had the side effect of making the diff a bit weird. Sorry! r? nia-e
This was referenced Sep 3, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 3, 2026
…uwer Rollup of 12 pull requests Successful merges: - #161227 (implement `Add` and `Sub` for `Complex`) - #161280 (make target feature ABI check a hard error on ARM) - #161893 (Add custom allocator support to `(try_)map` on `UniqueArc` and `UniqueRc`) - #162154 (fix[154166]: closure debug capture print) - #161951 (Windows: add fallback if `canonicalize` fails) - #162173 (fix supposedly unreachable `bug!` being reachable) - #162180 (remove outdated next-solver handling) - #162191 (core: mark float `ClampBounds` methods as `#[inline]`) - #162195 (docs(time): clarify exact seconds for week and day) - #162199 (docs(time): clarify exact seconds for hour and minute) - #162222 (coverage: Small cleanups in `extract_hir_info`) - #162230 (Pass -Z merge-functions=disabled in tests/codegen-llvm/intrinsics/unchecked_math.rs)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 4, 2026
…uwer Rollup of 12 pull requests Successful merges: - #161227 (implement `Add` and `Sub` for `Complex`) - #161280 (make target feature ABI check a hard error on ARM) - #161893 (Add custom allocator support to `(try_)map` on `UniqueArc` and `UniqueRc`) - #162154 (fix[154166]: closure debug capture print) - #161951 (Windows: add fallback if `canonicalize` fails) - #162173 (fix supposedly unreachable `bug!` being reachable) - #162180 (remove outdated next-solver handling) - #162191 (core: mark float `ClampBounds` methods as `#[inline]`) - #162195 (docs(time): clarify exact seconds for week and day) - #162199 (docs(time): clarify exact seconds for hour and minute) - #162222 (coverage: Small cleanups in `extract_hir_info`) - #162230 (Pass -Z merge-functions=disabled in tests/codegen-llvm/intrinsics/unchecked_math.rs)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 4, 2026
Rollup merge of #161893 - maxdexh:unique-arc-map, r=nia-e Add custom allocator support to `(try_)map` on `UniqueArc` and `UniqueRc` Follow-up to #161617. This one required me to add allocator support to a lot more methods. Probably good for them to have it for future additions ^^ The old, allocator-free methods went unused from this change and I had to remove them because we don't allow warnings (they are trivial to implement on top of the allocator ones). This had the side effect of making the diff a bit weird. Sorry! r? nia-e
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.
Follow-up to #161617.
This one required me to add allocator support to a lot more methods.
Probably good for them to have it for future additions ^^
The old, allocator-free methods went unused from this change and I had to remove them because we don't allow warnings (they are trivial to implement on top of the allocator ones). This had the side effect of making the diff a bit weird. Sorry!
r? nia-e