diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-09-24 14:31:00 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-09-25 03:02:05 -0700 |
| commit | efc98fcbebfd91b65b3de6070718247aafcc1c33 (patch) | |
| tree | cfbb1ada9f556e2c7ecab7cae45b7e371b71993f /lib/std/builtin.zig | |
| parent | a40cdad18c06fd377622c47aa34564df7ea959b5 (diff) | |
| download | zig-efc98fcbebfd91b65b3de6070718247aafcc1c33.tar.gz zig-efc98fcbebfd91b65b3de6070718247aafcc1c33.zip | |
disallow non-scalar sentinel types
see #17969
Diffstat (limited to 'lib/std/builtin.zig')
| -rw-r--r-- | lib/std/builtin.zig | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig index ccd46d874d..abbdf89c0a 100644 --- a/lib/std/builtin.zig +++ b/lib/std/builtin.zig @@ -887,12 +887,6 @@ pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace, ret_addr } } -pub fn checkNonScalarSentinel(expected: anytype, actual: @TypeOf(expected)) void { - if (!std.meta.eql(expected, actual)) { - panicSentinelMismatch(expected, actual); - } -} - pub fn panicSentinelMismatch(expected: anytype, actual: @TypeOf(expected)) noreturn { @branchHint(.cold); std.debug.panicExtra(null, @returnAddress(), "sentinel mismatch: expected {any}, found {any}", .{ expected, actual }); |
