diff options
| author | Brent Kerby <blkerby@gmail.com> | 2019-05-23 09:04:01 -0600 |
|---|---|---|
| committer | Brent Kerby <blkerby@gmail.com> | 2019-05-23 09:04:01 -0600 |
| commit | 941ca6f3e29655be69aa0f263077cf9f185b2ea8 (patch) | |
| tree | c602a802d7b7164cda28eaf0e082e528deed40b5 | |
| parent | 119bbc2056a60e8557d1e5f2e0a7ab46d479bcaf (diff) | |
| download | rust-941ca6f3e29655be69aa0f263077cf9f185b2ea8.tar.gz rust-941ca6f3e29655be69aa0f263077cf9f185b2ea8.zip | |
Clarify docs for unreachable! macro
| -rw-r--r-- | src/libcore/macros.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index d2ee9b11b36..168fc042476 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 +/// 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 |
