authorgravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-04-11 16:04:57-07:00
committergravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-04-12 04:01:30-07:00
logac207073f3426e615e7d4735994f73f67af7ee8e
tree5e097d614d395f778fe3369911c50c52077c1bf0
parentcbd7f54f06e788f54573dbbe261b9defad32020b

Reverts renaming of builtin.StackTrace -> ErrorReturnTrace

We can defer this change until the next time zig1 needs to be updated

117 files changed, 142 insertions(+), 141 deletions(-)

doc/langref.html.in+1-1
...@@ -4900,7 +4900,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val...@@ -4900,7 +4900,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
4900 {#header_close#}4900 {#header_close#}
49014901
4902 {#header_open|@errorReturnTrace#}4902 {#header_open|@errorReturnTrace#}
4903 <pre>{#syntax#}@errorReturnTrace() ?*builtin.ErrorReturnTrace{#endsyntax#}</pre>4903 <pre>{#syntax#}@errorReturnTrace() ?*builtin.StackTrace{#endsyntax#}</pre>
4904 <p>4904 <p>
4905 If the binary is built with error return tracing, and this function is invoked in a4905 If the binary is built with error return tracing, and this function is invoked in a
4906 function that calls a function with an error or error union return type, returns a4906 function that calls a function with an error or error union return type, returns a
lib/build-web/main.zig+1-1
...@@ -40,7 +40,7 @@ pub const std_options: std.Options = .{...@@ -40,7 +40,7 @@ pub const std_options: std.Options = .{
40 .logFn = logFn,40 .logFn = logFn,
41};41};
4242
43pub fn panic(msg: []const u8, st: ?*std.debug.StackTrace, addr: ?usize) noreturn {43pub fn panic(msg: []const u8, st: ?*std.builtin.StackTrace, addr: ?usize) noreturn {
44 _ = st;44 _ = st;
45 _ = addr;45 _ = addr;
46 log.err("panic: {s}", .{msg});46 log.err("panic: {s}", .{msg});
lib/docs/wasm/main.zig+1-1
...@@ -33,7 +33,7 @@ pub const std_options: std.Options = .{...@@ -33,7 +33,7 @@ pub const std_options: std.Options = .{
33 //.log_level = .debug,33 //.log_level = .debug,
34};34};
3535
36pub fn panic(msg: []const u8, st: ?*std.debug.StackTrace, addr: ?usize) noreturn {36pub fn panic(msg: []const u8, st: ?*std.builtin.StackTrace, addr: ?usize) noreturn {
37 _ = st;37 _ = st;
38 _ = addr;38 _ = addr;
39 log.err("panic: {s}", .{msg});39 log.err("panic: {s}", .{msg});
lib/std/builtin.zig+1-1
...@@ -8,7 +8,7 @@ pub const assembly = @import("builtin/assembly.zig");...@@ -8,7 +8,7 @@ pub const assembly = @import("builtin/assembly.zig");
88
9/// This data structure is used by the Zig language code generation and9/// This data structure is used by the Zig language code generation and
10/// therefore must be kept in sync with the compiler implementation.10/// therefore must be kept in sync with the compiler implementation.
11pub const ErrorReturnTrace = struct {11pub const StackTrace = struct {
12 index: usize,12 index: usize,
13 instruction_addresses: []usize,13 instruction_addresses: []usize,
14};14};
lib/std/debug.zig+2-2
...@@ -816,7 +816,7 @@ pub const FormatStackTrace = struct {...@@ -816,7 +816,7 @@ pub const FormatStackTrace = struct {
816};816};
817817
818/// Write a previously captured error return trace to `writer`, annotated with source locations.818/// Write a previously captured error return trace to `writer`, annotated with source locations.
819pub fn writeErrorReturnTrace(et: *const std.builtin.ErrorReturnTrace, t: Io.Terminal) Writer.Error!void {819pub fn writeErrorReturnTrace(et: *const std.builtin.StackTrace, t: Io.Terminal) Writer.Error!void {
820 // We take the slice by value, preventing the length from being mutated if an error occurs while820 // We take the slice by value, preventing the length from being mutated if an error occurs while
821 // writing the stack trace.821 // writing the stack trace.
822 const len = @min(et.instruction_addresses.len, et.index);822 const len = @min(et.instruction_addresses.len, et.index);
...@@ -885,7 +885,7 @@ pub fn dumpStackTrace(st: *const StackTrace) void {...@@ -885,7 +885,7 @@ pub fn dumpStackTrace(st: *const StackTrace) void {
885}885}
886886
887/// A thin wrapper around `writeErrorReturnTrace` which writes to stderr and ignores write errors.887/// A thin wrapper around `writeErrorReturnTrace` which writes to stderr and ignores write errors.
888pub fn dumpErrorReturnTrace(et: *const std.builtin.ErrorReturnTrace) void {888pub fn dumpErrorReturnTrace(et: *const std.builtin.StackTrace) void {
889 const stderr = lockStderr(&.{}).terminal();889 const stderr = lockStderr(&.{}).terminal();
890 defer unlockStderr();890 defer unlockStderr();
891 writeErrorReturnTrace(et, stderr) catch |err| switch (err) {891 writeErrorReturnTrace(et, stderr) catch |err| switch (err) {
src/Sema.zig+23-22
...@@ -2252,8 +2252,9 @@ pub fn setupErrorReturnTrace(sema: *Sema, block: *Block, last_arg_index: usize)...@@ -2252,8 +2252,9 @@ pub fn setupErrorReturnTrace(sema: *Sema, block: *Block, last_arg_index: usize)
2252 });2252 });
2253 const addrs_ptr = try err_trace_block.addTy(.alloc, try pt.singleMutPtrType(addr_arr_ty));2253 const addrs_ptr = try err_trace_block.addTy(.alloc, try pt.singleMutPtrType(addr_arr_ty));
22542254
2255 const error_return_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .ErrorReturnTrace);2255 // var st: StackTrace = undefined;
2256 const st_ptr = try err_trace_block.addTy(.alloc, try pt.singleMutPtrType(error_return_trace_ty));2256 const stack_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .StackTrace);
2257 const st_ptr = try err_trace_block.addTy(.alloc, try pt.singleMutPtrType(stack_trace_ty));
22572258
2258 // st.instruction_addresses = &addrs;2259 // st.instruction_addresses = &addrs;
2259 const instruction_addresses_field_name = try ip.getOrPutString(gpa, io, pt.tid, "instruction_addresses", .no_embedded_nulls);2260 const instruction_addresses_field_name = try ip.getOrPutString(gpa, io, pt.tid, "instruction_addresses", .no_embedded_nulls);
...@@ -6165,10 +6166,10 @@ pub fn analyzeSaveErrRetIndex(sema: *Sema, block: *Block) SemaError!Air.Inst.Ref...@@ -6165,10 +6166,10 @@ pub fn analyzeSaveErrRetIndex(sema: *Sema, block: *Block) SemaError!Air.Inst.Ref
61656166
6166 if (!block.ownerModule().error_tracing) return .none;6167 if (!block.ownerModule().error_tracing) return .none;
61676168
6168 const error_return_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .ErrorReturnTrace);6169 const stack_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .StackTrace);
6169 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);6170 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);
6170 const field_index = sema.structFieldIndex(block, error_return_trace_ty, field_name, LazySrcLoc.unneeded) catch |err| switch (err) {6171 const field_index = sema.structFieldIndex(block, stack_trace_ty, field_name, LazySrcLoc.unneeded) catch |err| switch (err) {
6171 error.AnalysisFail => @panic("std.builtin.ErrorReturnTrace is corrupt"),6172 error.AnalysisFail => @panic("std.builtin.StackTrace is corrupt"),
6172 error.ComptimeReturn, error.ComptimeBreak => unreachable,6173 error.ComptimeReturn, error.ComptimeBreak => unreachable,
6173 error.OutOfMemory, error.Canceled => |e| return e,6174 error.OutOfMemory, error.Canceled => |e| return e,
6174 };6175 };
...@@ -6176,7 +6177,7 @@ pub fn analyzeSaveErrRetIndex(sema: *Sema, block: *Block) SemaError!Air.Inst.Ref...@@ -6176,7 +6177,7 @@ pub fn analyzeSaveErrRetIndex(sema: *Sema, block: *Block) SemaError!Air.Inst.Ref
6176 return try block.addInst(.{6177 return try block.addInst(.{
6177 .tag = .save_err_return_trace_index,6178 .tag = .save_err_return_trace_index,
6178 .data = .{ .ty_pl = .{6179 .data = .{ .ty_pl = .{
6179 .ty = Air.internedToRef(error_return_trace_ty.toIntern()),6180 .ty = Air.internedToRef(stack_trace_ty.toIntern()),
6180 .payload = @intCast(field_index),6181 .payload = @intCast(field_index),
6181 } },6182 } },
6182 });6183 });
...@@ -6208,11 +6209,11 @@ fn popErrorReturnTrace(...@@ -6208,11 +6209,11 @@ fn popErrorReturnTrace(
6208 // AstGen determined this result does not go to an error-handling expr (try/catch/return etc.), or6209 // AstGen determined this result does not go to an error-handling expr (try/catch/return etc.), or
6209 // the result is comptime-known to be a non-error. Either way, pop unconditionally.6210 // the result is comptime-known to be a non-error. Either way, pop unconditionally.
62106211
6211 const error_return_trace_ty = try sema.getBuiltinType(src, .ErrorReturnTrace);6212 const stack_trace_ty = try sema.getBuiltinType(src, .StackTrace);
6212 const ptr_error_return_trace_ty = try pt.singleMutPtrType(error_return_trace_ty);6213 const ptr_stack_trace_ty = try pt.singleMutPtrType(stack_trace_ty);
6213 const err_return_trace = try block.addTy(.err_return_trace, ptr_error_return_trace_ty);6214 const err_return_trace = try block.addTy(.err_return_trace, ptr_stack_trace_ty);
6214 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);6215 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);
6215 const field_ptr = try sema.structFieldPtr(block, src, err_return_trace, field_name, src, error_return_trace_ty);6216 const field_ptr = try sema.structFieldPtr(block, src, err_return_trace, field_name, src, stack_trace_ty);
6216 try sema.storePtr2(block, src, field_ptr, src, saved_error_trace_index, src, .store);6217 try sema.storePtr2(block, src, field_ptr, src, saved_error_trace_index, src, .store);
6217 } else if (is_non_error == null) {6218 } else if (is_non_error == null) {
6218 // The result might be an error. If it is, we leave the error trace alone. If it isn't, we need6219 // The result might be an error. If it is, we leave the error trace alone. If it isn't, we need
...@@ -6233,11 +6234,11 @@ fn popErrorReturnTrace(...@@ -6233,11 +6234,11 @@ fn popErrorReturnTrace(
6233 defer then_block.instructions.deinit(gpa);6234 defer then_block.instructions.deinit(gpa);
62346235
6235 // If non-error, then pop the error return trace by restoring the index.6236 // If non-error, then pop the error return trace by restoring the index.
6236 const error_return_trace_ty = try sema.getBuiltinType(src, .ErrorReturnTrace);6237 const stack_trace_ty = try sema.getBuiltinType(src, .StackTrace);
6237 const ptr_error_return_trace_ty = try pt.singleMutPtrType(error_return_trace_ty);6238 const ptr_stack_trace_ty = try pt.singleMutPtrType(stack_trace_ty);
6238 const err_return_trace = try then_block.addTy(.err_return_trace, ptr_error_return_trace_ty);6239 const err_return_trace = try then_block.addTy(.err_return_trace, ptr_stack_trace_ty);
6239 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);6240 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);
6240 const field_ptr = try sema.structFieldPtr(&then_block, src, err_return_trace, field_name, src, error_return_trace_ty);6241 const field_ptr = try sema.structFieldPtr(&then_block, src, err_return_trace, field_name, src, stack_trace_ty);
6241 try sema.storePtr2(&then_block, src, field_ptr, src, saved_error_trace_index, src, .store);6242 try sema.storePtr2(&then_block, src, field_ptr, src, saved_error_trace_index, src, .store);
6242 _ = try then_block.addBr(cond_block_inst, .void_value);6243 _ = try then_block.addBr(cond_block_inst, .void_value);
62436244
...@@ -6372,15 +6373,15 @@ fn zirCall(...@@ -6372,15 +6373,15 @@ fn zirCall(
6372 // If any input is an error-type, we might need to pop any trace it generated. Otherwise, we only6373 // If any input is an error-type, we might need to pop any trace it generated. Otherwise, we only
6373 // need to clean-up our own trace if we were passed to a non-error-handling expression.6374 // need to clean-up our own trace if we were passed to a non-error-handling expression.
6374 if (input_is_error or (pop_error_return_trace and return_ty.isError(zcu))) {6375 if (input_is_error or (pop_error_return_trace and return_ty.isError(zcu))) {
6375 const error_return_trace_ty = try sema.getBuiltinType(call_src, .ErrorReturnTrace);6376 const stack_trace_ty = try sema.getBuiltinType(call_src, .StackTrace);
6376 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);6377 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);
6377 const field_index = try sema.structFieldIndex(block, error_return_trace_ty, field_name, call_src);6378 const field_index = try sema.structFieldIndex(block, stack_trace_ty, field_name, call_src);
63786379
6379 // Insert a save instruction before the arg resolution + call instructions we just generated6380 // Insert a save instruction before the arg resolution + call instructions we just generated
6380 const save_inst = try block.insertInst(block_index, .{6381 const save_inst = try block.insertInst(block_index, .{
6381 .tag = .save_err_return_trace_index,6382 .tag = .save_err_return_trace_index,
6382 .data = .{ .ty_pl = .{6383 .data = .{ .ty_pl = .{
6383 .ty = Air.internedToRef(error_return_trace_ty.toIntern()),6384 .ty = Air.internedToRef(stack_trace_ty.toIntern()),
6384 .payload = @intCast(field_index),6385 .payload = @intCast(field_index),
6385 } },6386 } },
6386 });6387 });
...@@ -19528,13 +19529,13 @@ fn getErrorReturnTrace(sema: *Sema, block: *Block) CompileError!Air.Inst.Ref {...@@ -19528,13 +19529,13 @@ fn getErrorReturnTrace(sema: *Sema, block: *Block) CompileError!Air.Inst.Ref {
19528 const pt = sema.pt;19529 const pt = sema.pt;
19529 const zcu = pt.zcu;19530 const zcu = pt.zcu;
19530 const ip = &zcu.intern_pool;19531 const ip = &zcu.intern_pool;
19531 const error_return_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .ErrorReturnTrace);19532 const stack_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .StackTrace);
19532 const ptr_error_return_trace_ty = try pt.singleMutPtrType(error_return_trace_ty);19533 const ptr_stack_trace_ty = try pt.singleMutPtrType(stack_trace_ty);
19533 const opt_ptr_error_return_trace_ty = try pt.optionalType(ptr_error_return_trace_ty.toIntern());19534 const opt_ptr_stack_trace_ty = try pt.optionalType(ptr_stack_trace_ty.toIntern());
1953419535
19535 switch (sema.owner.unwrap()) {19536 switch (sema.owner.unwrap()) {
19536 .func => |func| if (ip.funcAnalysisUnordered(func).has_error_trace and block.ownerModule().error_tracing) {19537 .func => |func| if (ip.funcAnalysisUnordered(func).has_error_trace and block.ownerModule().error_tracing) {
19537 return block.addTy(.err_return_trace, opt_ptr_error_return_trace_ty);19538 return block.addTy(.err_return_trace, opt_ptr_stack_trace_ty);
19538 },19539 },
1953919540
19540 .@"comptime",19541 .@"comptime",
...@@ -19546,7 +19547,7 @@ fn getErrorReturnTrace(sema: *Sema, block: *Block) CompileError!Air.Inst.Ref {...@@ -19546,7 +19547,7 @@ fn getErrorReturnTrace(sema: *Sema, block: *Block) CompileError!Air.Inst.Ref {
19546 => {},19547 => {},
19547 }19548 }
19548 return Air.internedToRef(try pt.intern(.{ .opt = .{19549 return Air.internedToRef(try pt.intern(.{ .opt = .{
19549 .ty = opt_ptr_error_return_trace_ty.toIntern(),19550 .ty = opt_ptr_stack_trace_ty.toIntern(),
19550 .val = .none,19551 .val = .none,
19551 } }));19552 } }));
19552}19553}
src/Zcu.zig+2-2
...@@ -434,7 +434,7 @@ pub const BuiltinDecl = enum {...@@ -434,7 +434,7 @@ pub const BuiltinDecl = enum {
434 AddressSpace,434 AddressSpace,
435 CallingConvention,435 CallingConvention,
436 returnError,436 returnError,
437 ErrorReturnTrace,437 StackTrace,
438 SourceLocation,438 SourceLocation,
439 CallModifier,439 CallModifier,
440 AtomicOrder,440 AtomicOrder,
...@@ -512,7 +512,7 @@ pub const BuiltinDecl = enum {...@@ -512,7 +512,7 @@ pub const BuiltinDecl = enum {
512 return switch (decl) {512 return switch (decl) {
513 .returnError => .func,513 .returnError => .func,
514514
515 .ErrorReturnTrace,515 .StackTrace,
516 .CallingConvention,516 .CallingConvention,
517 .SourceLocation,517 .SourceLocation,
518 .Signedness,518 .Signedness,
src/codegen/llvm.zig+1-1
...@@ -3374,7 +3374,7 @@ pub const Object = struct {...@@ -3374,7 +3374,7 @@ pub const Object = struct {
3374 }3374 }
33753375
3376 if (fn_info.cc == .auto and zcu.comp.config.any_error_tracing) {3376 if (fn_info.cc == .auto and zcu.comp.config.any_error_tracing) {
3377 // First parameter is a pointer to `std.builtin.ErrorReturnTrace`.3377 // First parameter is a pointer to `std.builtin.StackTrace`.
3378 const llvm_ptr_ty = try o.builder.ptrType(toLlvmAddressSpace(.generic, target));3378 const llvm_ptr_ty = try o.builder.ptrType(toLlvmAddressSpace(.generic, target));
3379 try llvm_params.append(o.gpa, llvm_ptr_ty);3379 try llvm_params.append(o.gpa, llvm_ptr_ty);
3380 }3380 }
test/cases/compile_errors/panic_has_source_location.zig+1-1
...@@ -6,7 +6,7 @@ export fn foo() void {...@@ -6,7 +6,7 @@ export fn foo() void {
6 @panic("oh no");6 @panic("oh no");
7}7}
88
9pub fn panic(_: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {9pub fn panic(_: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
10 @compileError("panic");10 @compileError("panic");
11}11}
1212
test/cases/safety/@alignCast misaligned.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "incorrect alignment")) {5 if (std.mem.eql(u8, message, "incorrect alignment")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@enumFromInt - no matching tag value.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "invalid enum value")) {5 if (std.mem.eql(u8, message, "invalid enum value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@enumFromInt truncated bits - exhaustive.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 if (std.mem.eql(u8, message, "invalid enum value")) {4 if (std.mem.eql(u8, message, "invalid enum value")) {
5 std.process.exit(0);5 std.process.exit(0);
6 }6 }
test/cases/safety/@enumFromInt truncated bits - nonexhaustive.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 if (std.mem.eql(u8, message, "invalid enum value")) {4 if (std.mem.eql(u8, message, "invalid enum value")) {
5 std.process.exit(0);5 std.process.exit(0);
6 }6 }
test/cases/safety/@errorCast error not present in destination.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "invalid error code")) {5 if (std.mem.eql(u8, message, "invalid error code")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@errorCast error union casted to disjoint set.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "invalid error code")) {5 if (std.mem.eql(u8, message, "invalid error code")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@intCast to u0.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - i0 max.zig +1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1const std = @import("std");1const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3 _ = stack_trace;3 _ = stack_trace;
4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
5 std.process.exit(0);5 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - i0 min.zig +1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1const std = @import("std");1const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3 _ = stack_trace;3 _ = stack_trace;
4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
5 std.process.exit(0);5 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - signed max.zig +1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1const std = @import("std");1const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3 _ = stack_trace;3 _ = stack_trace;
4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
5 std.process.exit(0);5 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - signed min.zig +1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1const std = @import("std");1const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3 _ = stack_trace;3 _ = stack_trace;
4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
5 std.process.exit(0);5 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - u0 max.zig +1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1const std = @import("std");1const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3 _ = stack_trace;3 _ = stack_trace;
4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
5 std.process.exit(0);5 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - u0 min.zig +1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1const std = @import("std");1const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3 _ = stack_trace;3 _ = stack_trace;
4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
5 std.process.exit(0);5 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - unsigned max.zig +1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1const std = @import("std");1const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3 _ = stack_trace;3 _ = stack_trace;
4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
5 std.process.exit(0);5 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - unsigned min.zig +1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1const std = @import("std");1const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3 _ = stack_trace;3 _ = stack_trace;
4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
5 std.process.exit(0);5 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - vector max.zig +1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1const std = @import("std");1const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3 _ = stack_trace;3 _ = stack_trace;
4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
5 std.process.exit(0);5 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - vector min.zig +1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1const std = @import("std");1const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3 _ = stack_trace;3 _ = stack_trace;
4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {4 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
5 std.process.exit(0);5 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - negative out of range.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {5 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - negative to unsigned.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {5 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - positive out of range.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {5 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@ptrFromInt address zero to non-optional byte-aligned pointer.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {5 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@ptrFromInt address zero to non-optional pointer.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {5 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@ptrFromInt with misaligned address.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "incorrect alignment")) {5 if (std.mem.eql(u8, message, "incorrect alignment")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@tagName on corrupted enum value.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "invalid enum value")) {5 if (std.mem.eql(u8, message, "invalid enum value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/@tagName on corrupted union value.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "invalid enum value")) {5 if (std.mem.eql(u8, message, "invalid enum value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/array slice sentinel mismatch vector.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "sentinel mismatch: expected { 0, 0 }, found { 4, 4 }")) {5 if (std.mem.eql(u8, message, "sentinel mismatch: expected { 0, 0 }, found { 4, 4 }")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/array slice sentinel mismatch.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) {5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/bad union field access.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "access of union field 'float' while field 'int' is active")) {5 if (std.mem.eql(u8, message, "access of union field 'float' while field 'int' is active")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/calling panic.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "oh no")) {5 if (std.mem.eql(u8, message, "oh no")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/cast []u8 to bigger slice of wrong size.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "exact division produced remainder")) {5 if (std.mem.eql(u8, message, "exact division produced remainder")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/cast integer to global error and no code matches.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "invalid error code")) {5 if (std.mem.eql(u8, message, "invalid error code")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/empty slice with sentinel out of bounds.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "index out of bounds: index 1, len 0")) {5 if (std.mem.eql(u8, message, "index out of bounds: index 1, len 0")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/exact division failure - vectors.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "exact division produced remainder")) {5 if (std.mem.eql(u8, message, "exact division produced remainder")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/exact division failure.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "exact division produced remainder")) {5 if (std.mem.eql(u8, message, "exact division produced remainder")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/for_len_mismatch.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "for loop over objects with non-equal lengths")) {5 if (std.mem.eql(u8, message, "for loop over objects with non-equal lengths")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/for_len_mismatch_three.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "for loop over objects with non-equal lengths")) {5 if (std.mem.eql(u8, message, "for loop over objects with non-equal lengths")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/ignored expression integer overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/integer addition overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/integer division by zero - vectors.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "division by zero")) {5 if (std.mem.eql(u8, message, "division by zero")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/integer division by zero.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "division by zero")) {5 if (std.mem.eql(u8, message, "division by zero")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/integer multiplication overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/integer negation overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/integer subtraction overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/memcpy_alias.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "@memcpy arguments alias")) {5 if (std.mem.eql(u8, message, "@memcpy arguments alias")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/memcpy_len_mismatch.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "source and destination arguments have non-equal lengths")) {5 if (std.mem.eql(u8, message, "source and destination arguments have non-equal lengths")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/memmove_len_mismatch.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "source and destination arguments have non-equal lengths")) {5 if (std.mem.eql(u8, message, "source and destination arguments have non-equal lengths")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/memset_array_undefined_bytes.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/memset_array_undefined_large.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/memset_slice_undefined_bytes.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/memset_slice_undefined_large.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/modrem by zero.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "division by zero")) {5 if (std.mem.eql(u8, message, "division by zero")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/modulus by zero.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "division by zero")) {5 if (std.mem.eql(u8, message, "division by zero")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/noreturn returned.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "'noreturn' function returned")) {5 if (std.mem.eql(u8, message, "'noreturn' function returned")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/optional unwrap operator on C pointer.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "attempt to use null value")) {5 if (std.mem.eql(u8, message, "attempt to use null value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/optional unwrap operator on null pointer.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "attempt to use null value")) {5 if (std.mem.eql(u8, message, "attempt to use null value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/optional_empty_error_set.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, ra: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, ra: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 _ = ra;5 _ = ra;
6 if (std.mem.eql(u8, message, "attempt to use null value")) {6 if (std.mem.eql(u8, message, "attempt to use null value")) {
test/cases/safety/out of bounds array slice by length.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "index out of bounds: index 16, len 5")) {5 if (std.mem.eql(u8, message, "index out of bounds: index 16, len 5")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/out of bounds slice access.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "index out of bounds: index 4, len 4")) {5 if (std.mem.eql(u8, message, "index out of bounds: index 4, len 4")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/pointer casting null to non-optional pointer.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {5 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/pointer casting to null function pointer.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {5 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/pointer slice sentinel mismatch.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) {5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/remainder division by zero.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "division by zero")) {5 if (std.mem.eql(u8, message, "division by zero")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/shift left by huge amount.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "shift amount is greater than the type size")) {5 if (std.mem.eql(u8, message, "shift amount is greater than the type size")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/shift right by huge amount.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "shift amount is greater than the type size")) {5 if (std.mem.eql(u8, message, "shift amount is greater than the type size")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/signed integer division overflow - vectors.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/signed integer division overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/signed integer not fitting in cast to unsigned integer - widening.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/signed integer not fitting in cast to unsigned integer.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/signed shift left overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "left shift overflowed bits")) {5 if (std.mem.eql(u8, message, "left shift overflowed bits")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/signed shift right overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "right shift overflowed bits")) {5 if (std.mem.eql(u8, message, "right shift overflowed bits")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/signed-unsigned vector cast.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/slice by length sentinel mismatch on lhs.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 1, found 3")) {5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 1, found 3")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/slice by length sentinel mismatch on rhs.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 1, found 0")) {5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 1, found 0")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/slice sentinel mismatch - floats.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 1.2, found 4")) {5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 1.2, found 4")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/slice sentinel mismatch - optional pointers.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "sentinel mismatch: expected null, found i32@10")) {5 if (std.mem.eql(u8, message, "sentinel mismatch: expected null, found i32@10")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/slice slice sentinel mismatch.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) {5 if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/slice start index greater than end index.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "start index 10 is larger than end index 1")) {5 if (std.mem.eql(u8, message, "start index 10 is larger than end index 1")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/slice with sentinel out of bounds - runtime len.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) {5 if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/slice with sentinel out of bounds.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) {5 if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/slice_cast_change_len_0.zig+1-1
...@@ -13,7 +13,7 @@ pub fn main() void {...@@ -13,7 +13,7 @@ pub fn main() void {
13 std.process.exit(1);13 std.process.exit(1);
14}14}
1515
16pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {16pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
17 if (std.mem.eql(u8, message, "slice length '3' does not divide exactly into destination elements")) {17 if (std.mem.eql(u8, message, "slice length '3' does not divide exactly into destination elements")) {
18 std.process.exit(0);18 std.process.exit(0);
19 }19 }
test/cases/safety/slice_cast_change_len_1.zig+1-1
...@@ -13,7 +13,7 @@ pub fn main() void {...@@ -13,7 +13,7 @@ pub fn main() void {
13 std.process.exit(1);13 std.process.exit(1);
14}14}
1515
16pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {16pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
17 if (std.mem.eql(u8, message, "slice length '1' does not divide exactly into destination elements")) {17 if (std.mem.eql(u8, message, "slice length '1' does not divide exactly into destination elements")) {
18 std.process.exit(0);18 std.process.exit(0);
19 }19 }
test/cases/safety/slice_cast_change_len_2.zig+1-1
...@@ -13,7 +13,7 @@ pub fn main() void {...@@ -13,7 +13,7 @@ pub fn main() void {
13 std.process.exit(1);13 std.process.exit(1);
14}14}
1515
16pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {16pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
17 if (std.mem.eql(u8, message, "slice length '1' does not divide exactly into destination elements")) {17 if (std.mem.eql(u8, message, "slice length '1' does not divide exactly into destination elements")) {
18 std.process.exit(0);18 std.process.exit(0);
19 }19 }
test/cases/safety/slicing null C pointer - runtime len.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "attempt to use null value")) {5 if (std.mem.eql(u8, message, "attempt to use null value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/slicing null C pointer.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "attempt to use null value")) {5 if (std.mem.eql(u8, message, "attempt to use null value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/switch else on corrupt enum value - one prong.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "switch on corrupt value")) {5 if (std.mem.eql(u8, message, "switch on corrupt value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/switch else on corrupt enum value - union.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "switch on corrupt value")) {5 if (std.mem.eql(u8, message, "switch on corrupt value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/switch else on corrupt enum value.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "switch on corrupt value")) {5 if (std.mem.eql(u8, message, "switch on corrupt value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/switch on corrupted enum value.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "switch on corrupt value")) {5 if (std.mem.eql(u8, message, "switch on corrupt value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/switch on corrupted union value.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "switch on corrupt value")) {5 if (std.mem.eql(u8, message, "switch on corrupt value")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/truncating vector cast.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/unreachable.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "reached unreachable code")) {5 if (std.mem.eql(u8, message, "reached unreachable code")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/unsigned integer not fitting in cast to signed integer - same bit count.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/unsigned shift left overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "left shift overflowed bits")) {5 if (std.mem.eql(u8, message, "left shift overflowed bits")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/unsigned shift right overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "right shift overflowed bits")) {5 if (std.mem.eql(u8, message, "right shift overflowed bits")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/unsigned-signed vector cast.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/unwrap error switch.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "attempt to unwrap error: Whatever")) {5 if (std.mem.eql(u8, message, "attempt to unwrap error: Whatever")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/unwrap error.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "attempt to unwrap error: Whatever")) {5 if (std.mem.eql(u8, message, "attempt to unwrap error: Whatever")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/value does not fit in shortening cast - u0.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/value does not fit in shortening cast.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/vector integer addition overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/vector integer multiplication overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/vector integer negation overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/vector integer subtraction overflow.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer overflow")) {5 if (std.mem.eql(u8, message, "integer overflow")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/safety/zero casted to error.zig +1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const std = @import("std");1const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "invalid error code")) {5 if (std.mem.eql(u8, message, "invalid error code")) {
6 std.process.exit(0);6 std.process.exit(0);
test/cases/tail_call_noreturn.zig+2-2
...@@ -1,9 +1,9 @@...@@ -1,9 +1,9 @@
1const std = @import("std");1const std = @import("std");
2const builtin = std.builtin;2const builtin = std.builtin;
3pub fn foo(message: []const u8, stack_trace: ?*std.debug.StackTrace) noreturn {3pub fn foo(message: []const u8, stack_trace: ?*builtin.StackTrace) noreturn {
4 @call(.always_tail, bar, .{ message, stack_trace });4 @call(.always_tail, bar, .{ message, stack_trace });
5}5}
6pub fn bar(message: []const u8, stack_trace: ?*std.debug.StackTrace) noreturn {6pub fn bar(message: []const u8, stack_trace: ?*builtin.StackTrace) noreturn {
7 _ = message;7 _ = message;
8 _ = stack_trace;8 _ = stack_trace;
9 std.process.exit(0);9 std.process.exit(0);
test/standalone/compile_asm/main.zig+1-1
...@@ -4,7 +4,7 @@ export fn main(r0: u32, r1: u32, atags: u32) callconv(.c) noreturn {...@@ -4,7 +4,7 @@ export fn main(r0: u32, r1: u32, atags: u32) callconv(.c) noreturn {
4 _ = atags;4 _ = atags;
5 unreachable; // never gets run so it doesn't matter5 unreachable; // never gets run so it doesn't matter
6}6}
7pub fn panic(msg: []const u8, error_return_trace: ?*@import("std").debug.StackTrace, _: ?usize) noreturn {7pub fn panic(msg: []const u8, error_return_trace: ?*@import("std").builtin.StackTrace, _: ?usize) noreturn {
8 _ = msg;8 _ = msg;
9 _ = error_return_trace;9 _ = error_return_trace;
10 while (true) {}10 while (true) {}
test/standalone/issue_339/test.zig+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1const StackTrace = @import("std").debug.StackTrace;1const StackTrace = @import("std").builtin.StackTrace;
2pub fn panic(msg: []const u8, stack_trace: ?*StackTrace, _: ?usize) noreturn {2pub fn panic(msg: []const u8, stack_trace: ?*StackTrace, _: ?usize) noreturn {
3 _ = msg;3 _ = msg;
4 _ = stack_trace;4 _ = stack_trace;
test/tests.zig+1-1
...@@ -2291,7 +2291,7 @@ pub fn addCliTests(b: *std.Build) *Step {...@@ -2291,7 +2291,7 @@ pub fn addCliTests(b: *std.Build) *Step {
2291 \\ return num * num;2291 \\ return num * num;
2292 \\}2292 \\}
2293 \\extern fn zig_panic() noreturn;2293 \\extern fn zig_panic() noreturn;
2294 \\pub fn panic(msg: []const u8, error_return_trace: ?*@import("std").debug.StackTrace, _: ?usize) noreturn {2294 \\pub fn panic(msg: []const u8, error_return_trace: ?*@import("builtin").StackTrace, _: ?usize) noreturn {
2295 \\ _ = msg;2295 \\ _ = msg;
2296 \\ _ = error_return_trace;2296 \\ _ = error_return_trace;
2297 \\ zig_panic();2297 \\ zig_panic();