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 std::hint::unreachable_unchecked. #49906

Merged
merged 1 commit into from
Apr 24, 2018

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Apr 12, 2018

Closes #43751.

@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 Apr 12, 2018
@kennytm kennytm 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
Member

r? @sfackler

@lukaslueg
Copy link
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
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.

@pietroalbini
Copy link
Member

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

@sfackler
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 23, 2018

📌 Commit 5fe8c59 has been approved by sfackler

@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 23, 2018
@aturon
Copy link
Member

aturon commented Apr 23, 2018

@bors: rollup

kennytm added a commit to kennytm/rust that referenced this pull request Apr 24, 2018
Stabilize `std::hint::unreachable_unchecked`.

Closes rust-lang#43751.
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:master Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants