Skip to content

Add custom allocator support to (try_)map on UniqueArc and UniqueRc - #161893

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
maxdexh:unique-arc-map
Sep 4, 2026
Merged

Add custom allocator support to (try_)map on UniqueArc and UniqueRc#161893
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
maxdexh:unique-arc-map

Conversation

@maxdexh

@maxdexh maxdexh commented Aug 27, 2026

Copy link
Copy Markdown
Member

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 27, 2026
@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

rustbot commented Sep 1, 2026

Copy link
Copy Markdown
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 nia-e left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

View changes since this review

Comment thread library/alloc/src/rc.rs
Comment thread library/alloc/src/rc.rs
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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, these functions should probably also have A=Global impls

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 3, 2026
@rustbot

rustbot commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@nia-e

nia-e commented Sep 3, 2026

Copy link
Copy Markdown
Member

alright, we can do the deleted methods as a later pr. this makes sense to land now in the meantime.

@bors r+

@rust-bors

rust-bors Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 7791246 has been approved by nia-e

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 3, 2026
@maxdexh

maxdexh commented Sep 3, 2026

Copy link
Copy Markdown
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
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
rust-bors Bot merged commit 695248d into rust-lang:main Sep 4, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 4, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants