From 941ca6f3e29655be69aa0f263077cf9f185b2ea8 Mon Sep 17 00:00:00 2001 From: Brent Kerby Date: Thu, 23 May 2019 09:04:01 -0600 Subject: [PATCH 1/2] Clarify docs for unreachable! macro --- src/libcore/macros.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index d2ee9b11b3640..168fc0424764e 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 From 27c75372f116093110cf4230cac8672b0762cb92 Mon Sep 17 00:00:00 2001 From: Brent Kerby Date: Thu, 23 May 2019 17:34:10 -0600 Subject: [PATCH 2/2] Remove phrase "instead of a panic!" --- src/libcore/macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 168fc0424764e..9dfa09cf8a512 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -448,7 +448,7 @@ macro_rules! writeln { /// 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. +/// will cause undefined behavior if the code is reached. /// /// [`panic!`]: ../std/macro.panic.html /// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html