diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-01-29 18:45:08 +0000 |
|---|---|---|
| committer | Matthew Lugg <mlugg@mlugg.co.uk> | 2025-01-30 14:47:59 +0000 |
| commit | b01d6b156cf4d273be40a6e6288f4766f71f4a29 (patch) | |
| tree | 084bfcf9ad8dfbce7879f750383a3091f699f52f /lib/std/priority_queue.zig | |
| parent | c5e34df555a98c51919eb45b0ab2a5ee3b37f4bf (diff) | |
| download | zig-b01d6b156cf4d273be40a6e6288f4766f71f4a29.tar.gz zig-b01d6b156cf4d273be40a6e6288f4766f71f4a29.zip | |
compiler: add `intcast_safe` AIR instruction
This instruction is like `intcast`, but includes two safety checks:
* Checks that the int is in range of the destination type
* If the destination type is an exhaustive enum, checks that the int
is a named enum value
This instruction is locked behind the `safety_checked_instructions`
backend feature; if unsupported, Sema will emit a fallback, as with
other safety-checked instructions.
This instruction is used to add a missing safety check for `@enumFromInt`
truncating bits. This check also has a fallback for backends which do
not yet support `safety_checked_instructions`.
Resolves: #21946
Diffstat (limited to 'lib/std/priority_queue.zig')
0 files changed, 0 insertions, 0 deletions
