Skip to content

Add associated function Box::into_inner_with_allocator - #166271

Open
SleighPenguin22 wants to merge 3 commits into
rust-lang:mainfrom
SleighPenguin22:main
Open

SleighPenguin22 wants to merge 3 commits into
rust-lang:mainfrom
SleighPenguin22:main

Conversation

@SleighPenguin22

Copy link
Copy Markdown
Contributor

relevant to #80437 and #163177

I also made an ACP as recommended by the std-dev-guide

There is already an (unstable) associated function Box::into_inner(). with custom allocators become more stable, this would be a nice addition.

@rustbot rustbot added A-box Area: Our favorite opsem complication 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 Nov 20, 2026
@rustbot

rustbot commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

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.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 38 candidates
  • Random selection from JohnTitor, Mark-Simulacrum

@SleighPenguin22

Copy link
Copy Markdown
Contributor Author

I just realized, in the implementation I added a new feature called box_into_inner_with_allocator, but it could probably use the same feature gate as Box::into_inner?

Comment thread library/alloc/src/boxed.rs Resolved
@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 Nov 20, 2026
@rustbot

rustbot commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

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

@maxdexh

maxdexh commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

I just realized, in the implementation I added a new feature called box_into_inner_with_allocator, but it could probably use the same feature gate as Box::into_inner?

IIRC, Box::into_inner was controversial for being kinda useless (it is literally just *b, modulo drop timing). This function is much more useful.
If we want to stabilize both, we can do that, so I'd say keep them separate.
If you do keep them separate, please create a tracking issue.

SleighPenguin22 and others added 2 commits November 20, 2026 21:19
Co-authored-by: Max <maxdexh03@gmail.com>
@SleighPenguin22

Copy link
Copy Markdown
Contributor Author

@rustbot label +A-allocators

@rustbot rustbot added the A-allocators Area: Custom and system allocators label Nov 20, 2026
@SleighPenguin22

Copy link
Copy Markdown
Contributor Author

@rustbot ready

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

Copy link
Copy Markdown
Contributor Author

I created a tracking issue here #166276

@maxdexh maxdexh assigned maxdexh and unassigned Mark-Simulacrum Nov 21, 2026
@maxdexh maxdexh added the S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. label Nov 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocators Area: Custom and system allocators A-box Area: Our favorite opsem complication S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants