Stabilize unreachable_unchecked as const fn by jhpratt · Pull Request #89509 · rust-lang/rust (original) (raw)

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 }})

jhpratt

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)

@jhpratt

@rustbot rustbot added A-const-eval

Area: Constant evaluation, covers all const contexts (static, const fn, ...)

A-const-fn 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

r? @Mark-Simulacrum

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

@joshtriplett

@bors

📌 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

@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

@rfcbot

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.

@joshtriplett joshtriplett added the relnotes

Marks issues that should be documented in the release notes of the next release.

label

Oct 4, 2021

@nikomatsakis

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

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

@rfcbot

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

@rfcbot

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

@bors

📌 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

@JohnTitor

…_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

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Oct 15, 2021

@matthiaskrgr

…_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

@matthiaskrgr

…_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

@jackh726

…_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

@bors

@jhpratt jhpratt deleted the stabilize-const_unreachable_unchecked branch

October 16, 2021 09:53

@ojeda ojeda mentioned this pull request

Oct 16, 2021

95 tasks

Labels

A-const-eval

Area: Constant evaluation, covers all const contexts (static, const fn, ...)

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.