Fix drop handling in hint::select_unpredictable by Amanieu · Pull Request #139977 · rust-lang/rust (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation7 Commits1 Checks6 Files changed

Conversation

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

[ Show hidden characters]({{ revealButtonHref }})

Amanieu

This intrinsic doesn't drop the value that is not selected so this is manually done in the public function that wraps the intrinsic.

@Amanieu

This intrinsic doesn't drop the value that is not selected so this is manually done in the public function that wraps the intrinsic.

@rustbot

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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

Apr 17, 2025

@rustbot

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@RalfJung

Good catch!
Would it maybe make sense to restrict this function to Copy types?

@Amanieu

I tried that in #139933 but unfortunately that prevents the use of select_unpredictable for &mut T which are not Copy.

@RalfJung

Ah, we'd want NoDrop but we don't have that on the trait level... shame.

r=me for the implementation part of this PR once CI is happy. t-libs-api will have to make the final call regarding whether we want to support this function on types with drop glue.

@Amanieu

@bors

📌 Commit e5e5fb9 has been approved by RalfJung

It is now in the queue for this repository.

@bors bors 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

Apr 17, 2025

bors added a commit to rust-lang-ci/rust that referenced this pull request

Apr 17, 2025

@bors

…iaskrgr

Rollup of 8 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Apr 18, 2025

@rust-timer

Rollup merge of rust-lang#139977 - Amanieu:select_unpredictable_drop, r=RalfJung

Fix drop handling in hint::select_unpredictable

This intrinsic doesn't drop the value that is not selected so this is manually done in the public function that wraps the intrinsic.

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Apr 19, 2025

@matthiaskrgr

… r=RalfJung

Fix drop handling in hint::select_unpredictable

This intrinsic doesn't drop the value that is not selected so this is manually done in the public function that wraps the intrinsic.

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.