about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-05-28 11:48:53 +0200
committerGitHub <noreply@github.com>2019-05-28 11:48:53 +0200
commit08f77243552afbd5a4ed093dcf2aec9bcd9d41a4 (patch)
tree39adfeca673cfbe8b7c53b159e7a8fbb4c5c2afb /src/libcore
parent837b72c805f98d95a44ad4fc2b43ba6a8acb108a (diff)
parent27c75372f116093110cf4230cac8672b0762cb92 (diff)
downloadrust-08f77243552afbd5a4ed093dcf2aec9bcd9d41a4.tar.gz
rust-08f77243552afbd5a4ed093dcf2aec9bcd9d41a4.zip
Rollup merge of #61084 - blkerby:unreachable_doc, r=KodrAus
Clarify docs for unreachable! macro

Fixes #60754.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/macros.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index d2ee9b11b36..9dfa09cf8a5 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -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