| ... | @@ -4903,13 +4903,12 @@ test "errdefer unwinding" { | ... | @@ -4903,13 +4903,12 @@ test "errdefer unwinding" { |
| 4903 | {#header_close#} | 4903 | {#header_close#} |
| 4904 | {#header_open|unreachable#} | 4904 | {#header_open|unreachable#} |
| 4905 | <p> | 4905 | <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 |
| 4907 | {#syntax#}unreachable{#endsyntax#} emits a call to {#syntax#}panic{#endsyntax#} with the message <code>reached unreachable code</code>. | 4907 | {#syntax#}unreachable{#endsyntax#} emits a call to {#syntax#}panic{#endsyntax#} with the message <code>reached unreachable code</code>. |
| 4908 | </p> | 4908 | </p> |
| 4909 | <p> | 4909 | <p> |
| 4910 | In {#syntax#}ReleaseFast{#endsyntax#} mode, the optimizer uses the assumption that {#syntax#}unreachable{#endsyntax#} code | 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. However, <kbd>zig test</kbd> even in {#syntax#}ReleaseFast{#endsyntax#} mode | 4911 | will never be hit to perform optimizations. |
| 4912 | still emits {#syntax#}unreachable{#endsyntax#} as calls to {#syntax#}panic{#endsyntax#}. | | |
| 4913 | </p> | 4912 | </p> |
| 4914 | {#header_open|Basics#} | 4913 | {#header_open|Basics#} |
| 4915 | {#code_begin|test|test_unreachable#} | 4914 | {#code_begin|test|test_unreachable#} |