Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize const_black_box #135414

Merged
merged 1 commit into from
Jan 31, 2025
Merged

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jan 12, 2025

This has been unstably const since #92226, but a tracking issue was never created. Per discussion on Zulip, there should not be any blockers to making this const-stable. The function does not provide any functionality at compile time but does allow code reuse between const- and non-const functions, so stabilize it here.

Cc @rust-lang/libs-api, @rust-lang/lang and @rust-lang/wg-const-eval for a newly const-stable intrinsic.

@rustbot
Copy link
Collaborator

rustbot commented Jan 12, 2025

r? @thomcc

rustbot has assigned @thomcc.
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 12, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 12, 2025

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

cc @rust-lang/miri, @rust-lang/wg-const-eval

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@tgross35 tgross35 added T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 12, 2025
@dtolnay
Copy link
Member

dtolnay commented Jan 12, 2025

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Jan 12, 2025

Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Jan 12, 2025
@dtolnay dtolnay assigned dtolnay and unassigned thomcc Jan 12, 2025
@traviscross
Copy link
Contributor

@rfcbot reviewed
@rustbot labels +I-lang-nominated

@rustbot rustbot added the I-lang-nominated Nominated for discussion during a lang team meeting. label Jan 12, 2025
@tgross35 tgross35 added the I-lang-easy-decision Issue: The decision needed by the team is conjectured to be easy; this does not imply nomination label Jan 12, 2025
@RalfJung
Copy link
Member

Yeah this should be fine, even if we ever apply optimizations to const MIR we can just treat this function as an opaque call (and we should, since it'd be the same optimizations we apply for runtime MIR).

@nikomatsakis
Copy link
Contributor

@rfcbot reviewed

@scottmcm
Copy link
Member

Given that it's spec'd to not do anything, seems easy to support in const :)

@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Jan 20, 2025
@rfcbot
Copy link

rfcbot commented Jan 20, 2025

🔔 This is now entering its final comment period, as per the review above. 🔔

@traviscross traviscross removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Jan 22, 2025
@bors
Copy link
Contributor

bors commented Jan 27, 2025

☔ The latest upstream changes (presumably #135937) made this pull request unmergeable. Please resolve the merge conflicts.

This has been unstably const since [1], but a tracking issue was never
created. Per discussion on Zulip [2], there should not be any blockers
to making this const-stable. The function does not provide any
functionality at compile time but does allow code reuse between const-
and non-const functions, so stabilize it here.

[1]: rust-lang#92226
[2]: https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/const_black_box
@tgross35 tgross35 force-pushed the stabilize-const_black_box branch from a854d75 to 395f0c9 Compare January 27, 2025 07:57
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Jan 30, 2025
@rfcbot
Copy link

rfcbot commented Jan 30, 2025

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@tgross35
Copy link
Contributor Author

@bors r=dtolnay rollup

@bors
Copy link
Contributor

bors commented Jan 30, 2025

📌 Commit 395f0c9 has been approved by dtolnay

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 Jan 30, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 31, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#135414 (Stabilize `const_black_box`)
 - rust-lang#136150 (ci: use windows 2025 for i686-mingw)
 - rust-lang#136258 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 11))
 - rust-lang#136270 (Remove `NamedVarMap`.)
 - rust-lang#136278 (add constraint graph to polonius MIR dump)
 - rust-lang#136287 (LLVM changed the nocapture attribute to captures(none))
 - rust-lang#136291 (some test suite cleanups)
 - rust-lang#136296 (float::min/max: mention the non-determinism around signed 0)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b249760 into rust-lang:master Jan 31, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 31, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 31, 2025
Rollup merge of rust-lang#135414 - tgross35:stabilize-const_black_box, r=dtolnay

Stabilize `const_black_box`

This has been unstably const since rust-lang#92226, but a tracking issue was never created. Per [discussion on Zulip][zulip], there should not be any blockers to making this const-stable. The function does not provide any functionality at compile time but does allow code reuse between const- and non-const functions, so stabilize it here.

[zulip]: https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/const_black_box
@tgross35 tgross35 deleted the stabilize-const_black_box branch January 31, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. I-lang-easy-decision Issue: The decision needed by the team is conjectured to be easy; this does not imply nomination S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants