Skip to content

Commit b2cca1b

Browse files
authored
Rollup merge of rust-lang#61084 - blkerby:unreachable_doc, r=KodrAus
Clarify docs for unreachable! macro Fixes rust-lang#60754.
2 parents 32d9b74 + 27c7537 commit b2cca1b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libcore/macros.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,10 @@ macro_rules! writeln {
445445
/// * Iterators that dynamically terminate.
446446
///
447447
/// If the determination that the code is unreachable proves incorrect, the
448-
/// program immediately terminates with a [`panic!`]. The function [`unreachable_unchecked`],
449-
/// which belongs to the [`std::hint`] module, informs the compiler to
450-
/// optimize the code out of the release version entirely.
448+
/// program immediately terminates with a [`panic!`].
449+
///
450+
/// The unsafe counterpart of this macro is the [`unreachable_unchecked`] function, which
451+
/// will cause undefined behavior if the code is reached.
451452
///
452453
/// [`panic!`]: ../std/macro.panic.html
453454
/// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html

0 commit comments

Comments
 (0)