]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/macros.rs
Clarify docs for unreachable! macro
[rust.git] / src / libcore / macros.rs
index d2ee9b11b3640c2ffd32c64e9e0fc26ee809a2c6..168fc0424764e9d3767da2a6e70c07ea560094d9 100644 (file)
@@ -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
+/// instead of a [`panic!`] will cause undefined behavior if the code is reached.
 ///
 /// [`panic!`]:  ../std/macro.panic.html
 /// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html