authorgravatar for techatrix@mailbox.orgTechatrix <techatrix@mailbox.org> 2022-09-28 12:30:55+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-09-28 13:30:55+03:00
log9a2f17f9f9dfde9c5438ccb439b727e1e814c4f5
treef3c7d2183c2eaf8d18aaf9b074680d5c0de88964
parent779c2daa196c0cc8ac6d59441eb47228c1d65aa5
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Docs: clarify unreachable for ReleaseSmall


1 files changed, 3 insertions(+), 4 deletions(-)

doc/langref.html.in+3-4
......@@ -4903,13 +4903,12 @@ test "errdefer unwinding" {
49034903 {#header_close#}
49044904 {#header_open|unreachable#}
49054905 <p>
4906 In {#syntax#}Debug{#endsyntax#} and {#syntax#}ReleaseSafe{#endsyntax#} mode, and when using <kbd>zig test</kbd>,
4906 In {#link|Debug#} and {#link|ReleaseSafe#} mode
49074907 {#syntax#}unreachable{#endsyntax#} emits a call to {#syntax#}panic{#endsyntax#} with the message <code>reached unreachable code</code>.
49084908 </p>
49094909 <p>
4910 In {#syntax#}ReleaseFast{#endsyntax#} mode, the optimizer uses the assumption that {#syntax#}unreachable{#endsyntax#} code
4911 will never be hit to perform optimizations. However, <kbd>zig test</kbd> even in {#syntax#}ReleaseFast{#endsyntax#} mode
4912 still emits {#syntax#}unreachable{#endsyntax#} as calls to {#syntax#}panic{#endsyntax#}.
4910 In {#link|ReleaseFast#} and {#link|ReleaseSmall#} mode, the optimizer uses the assumption that {#syntax#}unreachable{#endsyntax#} code
4911 will never be hit to perform optimizations.
49134912 </p>
49144913 {#header_open|Basics#}
49154914 {#code_begin|test|test_unreachable#}