Skip to content

Remove Box::into_unique - #162763

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
maxdexh:remove-into-unique
Sep 14, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
maxdexh:remove-into-unique

Conversation

@maxdexh

@maxdexh maxdexh commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

As discussed on zulip, this PR removes the Box::into_unique method and also adds a test for into_raw_with_allocator.

Note that all uses of into_unique were already removed from std in #162732. The only remaining use was a Miri test.

I didn't copy over the "lose the tag" operation for the into_raw_with_allocator test, because the file you wanted me to put this in doesn't have -Zmiri-permissive-provenance ^^

r? RalfJung

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 14, 2026
@rustbot

rustbot commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

RalfJung is not on the review rotation at the moment.
They may take a while to respond.

@maxdexh
maxdexh marked this pull request as ready for review September 14, 2026 12:42
@rustbot

rustbot commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

@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 Sep 14, 2026
@maxdexh

maxdexh commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

Should I move the test changes to the miri repo and wait until it gets merged back to remove the method? Idk how this stuff usually works

@RalfJung

Copy link
Copy Markdown
Member

Nono it's fine. :)

@RalfJung RalfJung 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.

LGTM, thanks. :)
r=me with a better function name, once CI is green.

View changes since this review

Comment thread src/tools/miri/tests/pass/box-custom-alloc.rs Outdated
@maxdexh

maxdexh commented Sep 14, 2026 •

Copy link
Copy Markdown
Member Author

I don't have bors perms, so you're gonna have to r=yourself ^^

(or use whatever the delegate command was, idk nia did that once)

@RalfJung

Copy link
Copy Markdown
Member

@bors delegate+
Here you go. :)
(But please squash before approving.)

@rust-bors

rust-bors Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

✌️ @maxdexh, you can now approve this pull request!

If @RalfJung told you to "r=me" after making some further change, then please make that change and post @bors r=RalfJung.

View changes since this delegation.

Comment thread src/tools/miri/tests/pass/box-custom-alloc.rs
@maxdexh

maxdexh commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

@bors r=RalfJung

@rust-bors

rust-bors Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 1a21818 has been approved by RalfJung

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-review Status: Awaiting review from the assignee but also interested parties. labels Sep 14, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 14, 2026
…uwer

Rollup of 3 pull requests

Successful merges:

 - #162409 (Fix gap in const stability checks around intrinsics)
 - #162763 (Remove `Box::into_unique`)
 - #162766 (stop unleaking `&mut`s in std and the compiler)
@rust-bors
rust-bors Bot merged commit 4d21806 into rust-lang:main Sep 14, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 14, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 14, 2026
Rollup merge of #162763 - maxdexh:remove-into-unique, r=RalfJung

Remove `Box::into_unique`

As discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/What.20is.20the.20current.20state.20of.20unleaking.20a.20.60Box.3CT.2C.20Global.3E.60.3F/with/623860839), this PR removes the `Box::into_unique` method and also adds a test for `into_raw_with_allocator`.

Note that all uses of `into_unique` were already removed from std in #162732. The only remaining use was a Miri test.

I didn't copy over the "lose the tag" operation for the `into_raw_with_allocator` test, because the file you wanted me to put this in doesn't have `-Zmiri-permissive-provenance` ^^

r? RalfJung
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Sep 15, 2026
…uwer

Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#162409 (Fix gap in const stability checks around intrinsics)
 - rust-lang/rust#162763 (Remove `Box::into_unique`)
 - rust-lang/rust#162766 (stop unleaking `&mut`s in std and the compiler)
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (55e90fc): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: missing data
Artifact size: 406.86 MiB -> 407.62 MiB (0.19%)

@maxdexh
maxdexh deleted the remove-into-unique branch September 20, 2026 08:26
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.

4 participants