Skip to content

Commit

Permalink
langref: add missing ReleaseSmall when describing unreachable (ziglan…
Browse files Browse the repository at this point in the history
…g#13909)

Add a missing ReleaseSmall when describing unreachable in the try
section and the unreachable entry in the Keyword Reference section.

Additionally, transform Debug, ReleaseSafe, ReleaseFast and ReleaseSmall
into links in the try section.

Co-authored-by: Andrew Kelley <[email protected]>
  • Loading branch information
perillo and andrewrk authored Dec 13, 2022
1 parent 89a9e92 commit 17d85a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doc/langref.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -5472,7 +5472,8 @@ fn doAThing(str: []u8) !void {
<p>
Here we know for sure that "1234" will parse successfully. So we put the
{#syntax#}unreachable{#endsyntax#} value on the right hand side. {#syntax#}unreachable{#endsyntax#} generates
a panic in Debug and ReleaseSafe modes and undefined behavior in ReleaseFast mode. So, while we're debugging the
a panic in {#link|Debug#} and {#link|ReleaseSafe#} modes and undefined behavior in
{#link|ReleaseFast#} and {#link|ReleaseSmall#} modes. So, while we're debugging the
application, if there <em>was</em> a surprise error here, the application would crash
appropriately.
</p>
Expand Down Expand Up @@ -11891,7 +11892,7 @@ fn readU32Be() u32 {}
Depending on the build mode, {#syntax#}unreachable{#endsyntax#} may emit a panic.
<ul>
<li>Emits a panic in {#syntax#}Debug{#endsyntax#} and {#syntax#}ReleaseSafe{#endsyntax#} mode, or when using <kbd>zig test</kbd>.</li>
<li>Does not emit a panic in {#syntax#}ReleaseFast{#endsyntax#} mode, unless <kbd>zig test</kbd> is being used.</li>
<li>Does not emit a panic in {#syntax#}ReleaseFast{#endsyntax#} and {#syntax#}ReleaseSmall{#endsyntax#} mode.</li>
<li>See also {#link|unreachable#}</li>
</ul>
</td>
Expand Down

0 comments on commit 17d85a7

Please sign in to comment.