Skip to content

Stabilize std::hint::unreachable_unchecked. - #49906

Merged
bors merged 1 commit into
rust-lang:masterfrom
kennytm:stable-unreachable
Apr 24, 2018
Merged

Stabilize std::hint::unreachable_unchecked.#49906
bors merged 1 commit into
rust-lang:masterfrom
kennytm:stable-unreachable

Conversation

@kennytm

Copy link
Copy Markdown
Member

Closes#43751.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @Mark-Simulacrum

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 12, 2018
@kennytmkennytm added the relnotes Marks issues that should be documented in the release notes of the next release. label Apr 12, 2018
@Mark-Simulacrum

Copy link
Copy Markdown
Member

r? @sfackler

@lukaslueg

Copy link
Copy Markdown
Contributor

Maybe the docs should point out that undefined behaviour can occur if runtime could reach the point that was marked unreachable_unchecked, not just if. That is, the program might behave weirdly even if it does not reach the unreachable part, because the compiler made assumptions somewhere else.

It's a nuance in wording, yet people have been banging their heads with "catching" code reaching unreachable parts while debugging random segfaults: It's spooky action at a distance.

@hanna-kruppe

Copy link
Copy Markdown
Contributor

It's certainly worth reminding people of that since it's often not untuitive, but I want to be clear that this is not specific to unreachable: all Undefined Behavior is "time travelling" in the sense that a program that eventually executes UB has never had any meaning to begin with and thus implementations don't have to try and faithfully implement the part of the program trace before the UB operation. This is worth stressing, but if it's stressed in the documentation of one particular function, the docs should be careful to not imply that this is specific to said function.

@kennytm
kennytmforce-pushed the stable-unreachable branch from ab012e9 to 5fe8c59CompareApril 16, 2018 10:30
@emilyalbini

Copy link
Copy Markdown
Member

Ping from triage @sfackler! This PR needs your review!

@sfackler

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Apr 23, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 5fe8c59 has been approved by sfackler

@borsbors 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 23, 2018
@aturon

Copy link
Copy Markdown
Contributor

@bors: rollup

kennytm added a commit to kennytm/rust that referenced this pull request Apr 24, 2018
@kennytmkennytm mentioned this pull request Apr 24, 2018
bors added a commit that referenced this pull request Apr 24, 2018
Rollup of 11 pull requests
Successful merges:
- #49461 (std: Child::kill() returns error if process has already exited)
- #49727 (Add Cell::update)
- #49812 (Fix revision support for UI tests.)
- #49829 (Add doc links to `std::os` extension traits)
- #49906 (Stabilize `std::hint::unreachable_unchecked`.)
- #49970 (Deprecate Read::chars and char::decode_utf8)
- #49985 (don't see issue #0)
- #50118 (fix search bar bug)
- #50139 (encourage descriptive issue titles)
- #50174 (Use FxHashMap in syntax_pos::symbol::Interner::intern.)
- #50185 (core: Fix overflow in `int::mod_euc` when `self < 0 && rhs == MIN`)
Failed merges:
@bors
bors merged commit 5fe8c59 into rust-lang:masterApr 24, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

relnotesMarks issues that should be documented in the release notes of the next release.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@kennytm@rust-highfive@Mark-Simulacrum@lukaslueg@hanna-kruppe@emilyalbini@sfackler@bors@aturon