Skip to content

Commit

Permalink
Rollup merge of rust-lang#61084 - blkerby:unreachable_doc, r=KodrAus
Browse files Browse the repository at this point in the history
Clarify docs for unreachable! macro

Fixes rust-lang#60754.
  • Loading branch information
Centril authored May 27, 2019
2 parents 32d9b74 + 27c7537 commit b2cca1b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,10 @@ macro_rules! writeln {
/// * Iterators that dynamically terminate.
///
/// If the determination that the code is unreachable proves incorrect, the
/// program immediately terminates with a [`panic!`]. The function [`unreachable_unchecked`],
/// which belongs to the [`std::hint`] module, informs the compiler to
/// optimize the code out of the release version entirely.
/// program immediately terminates with a [`panic!`].
///
/// The unsafe counterpart of this macro is the [`unreachable_unchecked`] function, which
/// will cause undefined behavior if the code is reached.
///
/// [`panic!`]: ../std/macro.panic.html
/// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html
Expand Down

0 comments on commit b2cca1b

Please sign in to comment.