Rollup merge of #61084 - blkerby:unreachable_doc, r=KodrAus
Clarify docs for unreachable! macro Fixes #60754.
This commit is contained in:
commit
08f7724355
1 changed files with 4 additions and 3 deletions
|
@ -445,9 +445,10 @@ macro_rules! writeln {
|
||||||
/// * Iterators that dynamically terminate.
|
/// * Iterators that dynamically terminate.
|
||||||
///
|
///
|
||||||
/// If the determination that the code is unreachable proves incorrect, the
|
/// If the determination that the code is unreachable proves incorrect, the
|
||||||
/// program immediately terminates with a [`panic!`]. The function [`unreachable_unchecked`],
|
/// program immediately terminates with a [`panic!`].
|
||||||
/// which belongs to the [`std::hint`] module, informs the compiler to
|
///
|
||||||
/// optimize the code out of the release version entirely.
|
/// 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
|
/// [`panic!`]: ../std/macro.panic.html
|
||||||
/// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html
|
/// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue