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 unreachable_unchecked as const fn #89509

Merged

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Oct 4, 2021

Closes #53188

This PR stabilizes core::hint::unreachable_unchecked as const fn. MIRI is able to detect when this method is called. Stabilization was delayed until const_panic was stabilized so as to avoid users calling this method in its place (thus resulting in runtime UB). With #89508, that is no longer an issue.

@rustbot label +A-const-eval +A-const-fn +T-lang +S-blocked

(not sure why it's T-lang, but that's what the tracking issue is)

@rustbot rustbot added A-const-eval Area: Constant evaluation (MIR interpretation) A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. S-blocked Status: Blocked on something else such as an RFC or other implementation work. T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Oct 4, 2021
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 4, 2021
@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 4, 2021

📌 Commit 11140ff has been approved by joshtriplett

@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. S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Oct 4, 2021
@joshtriplett
Copy link
Member

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 4, 2021
@joshtriplett
Copy link
Member

@rfcbot merge

@rfcbot
Copy link

rfcbot commented Oct 4, 2021

Team member @joshtriplett 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!

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 Oct 4, 2021
@joshtriplett joshtriplett added the relnotes Marks issues that should be documented in the release notes of the next release. label Oct 4, 2021
@nikomatsakis
Copy link
Contributor

I'd like to see @RalfJung or @oli-obk weigh in, or perhaps a brief stabilization report. I'm not really particularly familiar with this intrinsic, I have to admit.

@RalfJung
Copy link
Member

RalfJung commented Oct 4, 2021

Yeah, this intrinsic is basically the simplest kind of UB we have, so with const_panic stable I see no reason not to stabilize this as well.

@nikomatsakis
Copy link
Contributor

@rfcbot fcp reviewed :)

@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 Oct 4, 2021
@rfcbot
Copy link

rfcbot commented Oct 4, 2021

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

@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 Oct 14, 2021
@rfcbot
Copy link

rfcbot commented Oct 14, 2021

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.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 14, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Oct 14, 2021

📌 Commit 11140ff has been approved by oli-obk

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 14, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Oct 15, 2021
…_unchecked, r=oli-obk

Stabilize `unreachable_unchecked` as `const fn`

Closes rust-lang#53188

This PR stabilizes `core::hint::unreachable_unchecked` as `const fn`. MIRI is able to detect when this method is called. Stabilization was delayed until `const_panic` was stabilized so as to avoid users calling this method in its place (thus resulting in runtime UB). With rust-lang#89508, that is no longer an issue.

`@rustbot` label +A-const-eval +A-const-fn +T-lang +S-blocked

(not sure why it's T-lang, but that's what the tracking issue is)
@jackh726
Copy link
Member

@bors rollup

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 15, 2021
…_unchecked, r=oli-obk

Stabilize `unreachable_unchecked` as `const fn`

Closes rust-lang#53188

This PR stabilizes `core::hint::unreachable_unchecked` as `const fn`. MIRI is able to detect when this method is called. Stabilization was delayed until `const_panic` was stabilized so as to avoid users calling this method in its place (thus resulting in runtime UB). With rust-lang#89508, that is no longer an issue.

`@rustbot` label +A-const-eval +A-const-fn +T-lang +S-blocked

(not sure why it's T-lang, but that's what the tracking issue is)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 15, 2021
…_unchecked, r=oli-obk

Stabilize `unreachable_unchecked` as `const fn`

Closes rust-lang#53188

This PR stabilizes `core::hint::unreachable_unchecked` as `const fn`. MIRI is able to detect when this method is called. Stabilization was delayed until `const_panic` was stabilized so as to avoid users calling this method in its place (thus resulting in runtime UB). With rust-lang#89508, that is no longer an issue.

``@rustbot`` label +A-const-eval +A-const-fn +T-lang +S-blocked

(not sure why it's T-lang, but that's what the tracking issue is)
jackh726 added a commit to jackh726/rust that referenced this pull request Oct 16, 2021
…_unchecked, r=oli-obk

Stabilize `unreachable_unchecked` as `const fn`

Closes rust-lang#53188

This PR stabilizes `core::hint::unreachable_unchecked` as `const fn`. MIRI is able to detect when this method is called. Stabilization was delayed until `const_panic` was stabilized so as to avoid users calling this method in its place (thus resulting in runtime UB). With rust-lang#89508, that is no longer an issue.

```@rustbot``` label +A-const-eval +A-const-fn +T-lang +S-blocked

(not sure why it's T-lang, but that's what the tracking issue is)
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 16, 2021
…askrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#89509 (Stabilize `unreachable_unchecked` as `const fn`)
 - rust-lang#89898 (Remove alloc::prelude)
 - rust-lang#89902 (Restrict the aarch64 outline atomics test to Linux)
 - rust-lang#89906 (Moved format-version constant to rustdoc-json-types)
 - rust-lang#89912 (emitter: current substitution can be multi-line)
 - rust-lang#89914 (Emit impl difference error for GenericBoundFailure too)
 - rust-lang#89915 (Some outlives cleanup)
 - rust-lang#89918 (Add some GATs related regression tests)
 - rust-lang#89921 ([fuchsia] Update process info struct)
 - rust-lang#89925 (updating docs to mention usage of AtomicBool)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9ae0804 into rust-lang:master Oct 16, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 16, 2021
@jhpratt jhpratt deleted the stabilize-const_unreachable_unchecked branch October 16, 2021 09:53
@jplatte jplatte mentioned this pull request Oct 21, 2021
65 tasks
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: Constant evaluation (MIR interpretation) A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. 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. relnotes Marks issues that should be documented in the release notes of the next release. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking Issue for const unreachable_unchecked