mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Docs: clarify unreachable for ReleaseSmall
This commit is contained in:
parent
779c2daa19
commit
9a2f17f9f9
1 changed files with 3 additions and 4 deletions
|
|
@ -4903,13 +4903,12 @@ test "errdefer unwinding" {
|
|||
{#header_close#}
|
||||
{#header_open|unreachable#}
|
||||
<p>
|
||||
In {#syntax#}Debug{#endsyntax#} and {#syntax#}ReleaseSafe{#endsyntax#} mode, and when using <kbd>zig test</kbd>,
|
||||
In {#link|Debug#} and {#link|ReleaseSafe#} mode
|
||||
{#syntax#}unreachable{#endsyntax#} emits a call to {#syntax#}panic{#endsyntax#} with the message <code>reached unreachable code</code>.
|
||||
</p>
|
||||
<p>
|
||||
In {#syntax#}ReleaseFast{#endsyntax#} mode, the optimizer uses the assumption that {#syntax#}unreachable{#endsyntax#} code
|
||||
will never be hit to perform optimizations. However, <kbd>zig test</kbd> even in {#syntax#}ReleaseFast{#endsyntax#} mode
|
||||
still emits {#syntax#}unreachable{#endsyntax#} as calls to {#syntax#}panic{#endsyntax#}.
|
||||
In {#link|ReleaseFast#} and {#link|ReleaseSmall#} mode, the optimizer uses the assumption that {#syntax#}unreachable{#endsyntax#} code
|
||||
will never be hit to perform optimizations.
|
||||
</p>
|
||||
{#header_open|Basics#}
|
||||
{#code_begin|test|test_unreachable#}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue