authorgravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-04-08 13:49:44-07:00
committergravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-04-12 04:01:29-07:00
log94ff38af87e9784fc78ad3186553c953860659c4
tree603ab10f0ca97fe8827029ee870f2f144799243c
parentcc15c8ae7e0b8d994e818f8275bf73617edefe68

Separates error return traces from stack traces

Doesn't commit the changes to stage1, we can generate those at the end once we're not making any more changes to it to avoid wasting storage.

123 files changed, 190 insertions(+), 175 deletions(-)

doc/langref.html.in+1-1
......@@ -4900,7 +4900,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
49004900 {#header_close#}
49014901
49024902 {#header_open|@errorReturnTrace#}
4903 <pre>{#syntax#}@errorReturnTrace() ?*builtin.StackTrace{#endsyntax#}</pre>
4903 <pre>{#syntax#}@errorReturnTrace() ?*builtin.ErrorReturnTrace{#endsyntax#}</pre>
49044904 <p>
49054905 If the binary is built with error return tracing, and this function is invoked in a
49064906 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 = .{
4040 .logFn = logFn,
4141};
4242
43pub fn panic(msg: []const u8, st: ?*std.builtin.StackTrace, addr: ?usize) noreturn {
43pub fn panic(msg: []const u8, st: ?*std.debug.StackTrace, addr: ?usize) noreturn {
4444 _ = st;
4545 _ = addr;
4646 log.err("panic: {s}", .{msg});
lib/docs/wasm/main.zig+1-1
......@@ -33,7 +33,7 @@ pub const std_options: std.Options = .{
3333 //.log_level = .debug,
3434};
3535
36pub fn panic(msg: []const u8, st: ?*std.builtin.StackTrace, addr: ?usize) noreturn {
36pub fn panic(msg: []const u8, st: ?*std.debug.StackTrace, addr: ?usize) noreturn {
3737 _ = st;
3838 _ = addr;
3939 log.err("panic: {s}", .{msg});
lib/std/Build/Step.zig+1-1
......@@ -67,7 +67,7 @@ test_results: TestResults,
6767
6868/// The return address associated with creation of this step that can be useful
6969/// to print along with debugging messages.
70debug_stack_trace: std.builtin.StackTrace,
70debug_stack_trace: std.debug.StackTrace,
7171
7272pub const TestResults = struct {
7373 /// The total number of tests in the step. Every test has a "status" from the following:
lib/std/builtin.zig+1-4
......@@ -8,12 +8,9 @@ pub const assembly = @import("builtin/assembly.zig");
88
99/// This data structure is used by the Zig language code generation and
1010/// therefore must be kept in sync with the compiler implementation.
11pub const StackTrace = struct {
11pub const ErrorReturnTrace = struct {
1212 index: usize,
1313 instruction_addresses: []usize,
14 /// Set to true if inlined frames are given their own entries in `instruction_addresses`,
15 /// otherwise set to false.
16 includes_inlined_frames: bool,
1714};
1815
1916/// This data structure is used by the Zig language code generation and
lib/std/debug.zig+36-15
......@@ -13,7 +13,6 @@ const windows = std.os.windows;
1313const builtin = @import("builtin");
1414const native_arch = builtin.cpu.arch;
1515const native_os = builtin.os.tag;
16const StackTrace = std.builtin.StackTrace;
1716
1817const root = @import("root");
1918
......@@ -568,7 +567,7 @@ pub fn defaultPanic(msg: []const u8, first_trace_addr: ?usize) noreturn {
568567
569568 if (@errorReturnTrace()) |t| if (t.index > 0) {
570569 writer.writeAll("error return context:\n") catch break :trace;
571 writeStackTrace(t, stderr) catch break :trace;
570 writeErrorReturnTrace(t, stderr) catch break :trace;
572571 writer.writeAll("\nstack trace:\n") catch break :trace;
573572 };
574573 writeCurrentStackTrace(.{
......@@ -607,6 +606,13 @@ fn waitForOtherThreadToFinishPanicking() void {
607606 }
608607}
609608
609/// This data structure is used by the Zig language code generation and
610/// therefore must be kept in sync with the compiler implementation.
611pub const StackTrace = struct {
612 index: usize,
613 instruction_addresses: []usize,
614};
615
610616pub const StackUnwindOptions = struct {
611617 /// If not `null`, we will ignore all frames up until this return address. This is typically
612618 /// used to omit intermediate handling code (for instance, a panic handler and its machinery)
......@@ -629,7 +635,6 @@ pub noinline fn captureCurrentStackTrace(options: StackUnwindOptions, addr_buf:
629635 const empty_trace: StackTrace = .{
630636 .index = 0,
631637 .instruction_addresses = &.{},
632 .includes_inlined_frames = false,
633638 };
634639 if (!std.options.allow_stack_tracing) return empty_trace;
635640 var it: StackIterator = .init(options.context);
......@@ -665,7 +670,6 @@ pub noinline fn captureCurrentStackTrace(options: StackUnwindOptions, addr_buf:
665670 return .{
666671 .index = index,
667672 .instruction_addresses = addr_buf[0..index],
668 .includes_inlined_frames = false,
669673 };
670674}
671675/// Write the current stack trace to `writer`, annotated with source locations.
......@@ -752,7 +756,7 @@ pub noinline fn writeCurrentStackTrace(options: StackUnwindOptions, t: Io.Termin
752756 // Subtract 1 to get an address *in* the function call for a better source location.
753757 try printSourceAtAddress(io, di, t, .{
754758 .address = ret_addr -| StackIterator.ra_call_offset,
755 .print_inlines = true,
759 .resolve_inline_callers = true,
756760 });
757761 printed_any_frame = true;
758762 },
......@@ -786,8 +790,17 @@ pub const FormatStackTrace = struct {
786790 }
787791};
788792
793/// Write a previously captured error return trace to `writer`, annotated with source locations.
794pub fn writeErrorReturnTrace(st: *const std.builtin.ErrorReturnTrace, t: Io.Terminal) Writer.Error!void {
795 try writeTrace(st, t, false);
796}
797
789798/// Write a previously captured stack trace to `writer`, annotated with source locations.
790pub fn writeStackTrace(st: *const StackTrace, t: Io.Terminal) Writer.Error!void {
799pub fn writeStackTrace(et: *const StackTrace, t: Io.Terminal) Writer.Error!void {
800 try writeTrace(et, t, true);
801}
802
803fn writeTrace(trace: anytype, t: Io.Terminal, resolve_inline_callers: bool) Writer.Error!void {
791804 const writer = t.writer;
792805 if (!std.options.allow_stack_tracing) {
793806 t.setColor(.dim) catch {};
......@@ -796,9 +809,9 @@ pub fn writeStackTrace(st: *const StackTrace, t: Io.Terminal) Writer.Error!void
796809 return;
797810 }
798811
799 // Fetch `st.index` straight away. Aside from avoiding redundant loads, this prevents issues if
800 // `st` is `@errorReturnTrace()` and errors are encountered while writing the stack trace.
801 const n_frames = st.index;
812 // Fetch `trace.index` straight away. Aside from avoiding redundant loads, this prevents issues if
813 // `trace` is `@errorReturnTrace()` and errors are encountered while writing the stack trace.
814 const n_frames = trace.index;
802815 if (n_frames == 0) return writer.writeAll("(empty stack trace)\n");
803816 const di = getSelfDebugInfo() catch |err| switch (err) {
804817 error.UnsupportedTarget => {
......@@ -809,13 +822,13 @@ pub fn writeStackTrace(st: *const StackTrace, t: Io.Terminal) Writer.Error!void
809822 },
810823 };
811824 const io = std.Options.debug_io;
812 const captured_frames = @min(n_frames, st.instruction_addresses.len);
813 for (st.instruction_addresses[0..captured_frames]) |ret_addr| {
825 const captured_frames = @min(n_frames, trace.instruction_addresses.len);
826 for (trace.instruction_addresses[0..captured_frames]) |ret_addr| {
814827 // `ret_addr` is the return address, which is *after* the function call.
815828 // Subtract 1 to get an address *in* the function call for a better source location.
816829 try printSourceAtAddress(io, di, t, .{
817830 .address = ret_addr -| StackIterator.ra_call_offset,
818 .print_inlines = !st.includes_inlined_frames,
831 .resolve_inline_callers = resolve_inline_callers,
819832 });
820833 }
821834 if (n_frames > captured_frames) {
......@@ -833,6 +846,15 @@ pub fn dumpStackTrace(st: *const StackTrace) void {
833846 };
834847}
835848
849/// A thin wrapper around `writeErrorReturnTrace` which writes to stderr and ignores write errors.
850pub fn dumpErrorReturnTrace(et: *const std.builtin.ErrorReturnTrace) void {
851 const stderr = lockStderr(&.{}).terminal();
852 defer unlockStderr();
853 writeErrorReturnTrace(et, stderr) catch |err| switch (err) {
854 error.WriteFailed => {},
855 };
856}
857
836858const StackIterator = union(enum) {
837859 /// We will first report the current PC of this `CpuContextPtr`, then we will switch to a
838860 /// different strategy to actually unwind.
......@@ -1124,7 +1146,7 @@ pub inline fn stripInstructionPtrAuthCode(ptr: usize) usize {
11241146
11251147const PrintSourceAddressOptions = struct {
11261148 address: usize,
1127 print_inlines: bool,
1149 resolve_inline_callers: bool,
11281150};
11291151
11301152fn printSourceAtAddress(
......@@ -1163,7 +1185,7 @@ fn printSourceAtAddress(
11631185 symbol.name orelse "???",
11641186 symbol.compile_unit_name orelse debug_info.getModuleName(io, options.address) catch "???",
11651187 );
1166 if (!options.print_inlines) break;
1188 if (!options.resolve_inline_callers) break;
11671189 }
11681190}
11691191fn printLineInfo(
......@@ -1708,7 +1730,6 @@ pub fn ConfigurableTrace(comptime size: usize, comptime stack_frame_count: usize
17081730 const stack_trace: StackTrace = .{
17091731 .index = frames.len,
17101732 .instruction_addresses = frames,
1711 .includes_inlined_frames = false,
17121733 };
17131734 writeStackTrace(&stack_trace, stderr) catch return;
17141735 }
lib/std/heap/debug_allocator.zig+2-4
......@@ -81,7 +81,7 @@
8181//! Resizing and remapping are forwarded directly to the backing allocator,
8282//! except where such operations would change the category from large to small.
8383const builtin = @import("builtin");
84const StackTrace = std.builtin.StackTrace;
84const StackTrace = std.debug.StackTrace;
8585
8686const std = @import("std");
8787const log = std.log.scoped(.DebugAllocator);
......@@ -229,7 +229,7 @@ pub fn DebugAllocator(comptime config: Config) type {
229229 std.debug.dumpStackTrace(self.getStackTrace(trace_kind));
230230 }
231231
232 fn getStackTrace(self: *LargeAlloc, trace_kind: TraceKind) std.builtin.StackTrace {
232 fn getStackTrace(self: *LargeAlloc, trace_kind: TraceKind) std.debug.StackTrace {
233233 assert(@intFromEnum(trace_kind) < trace_n);
234234 const stack_addresses = &self.stack_addresses[@intFromEnum(trace_kind)];
235235 var len: usize = 0;
......@@ -239,7 +239,6 @@ pub fn DebugAllocator(comptime config: Config) type {
239239 return .{
240240 .instruction_addresses = stack_addresses,
241241 .index = len,
242 .includes_inlined_frames = false,
243242 };
244243 }
245244
......@@ -342,7 +341,6 @@ pub fn DebugAllocator(comptime config: Config) type {
342341 return .{
343342 .instruction_addresses = stack_addresses,
344343 .index = len,
345 .includes_inlined_frames = false,
346344 };
347345 }
348346
lib/std/start.zig+1-1
......@@ -761,7 +761,7 @@ inline fn wrapMain(result: anytype) u8 {
761761 std.log.err("{t}", .{err});
762762 switch (native_os) {
763763 .freestanding, .other => {},
764 else => if (@errorReturnTrace()) |trace| std.debug.dumpStackTrace(trace),
764 else => if (@errorReturnTrace()) |trace| std.debug.dumpErrorReturnTrace(trace),
765765 }
766766 return 1;
767767 };
lib/std/testing/FailingAllocator.zig+1-1
......@@ -131,7 +131,7 @@ fn free(
131131}
132132
133133/// Only valid once `has_induced_failure == true`
134pub fn getStackTrace(self: *FailingAllocator) std.builtin.StackTrace {
134pub fn getStackTrace(self: *FailingAllocator) std.debug.StackTrace {
135135 std.debug.assert(self.has_induced_failure);
136136 var len: usize = 0;
137137 while (len < self.stack_addresses.len and self.stack_addresses[len] != 0) {
src/Sema.zig+22-23
......@@ -2252,9 +2252,8 @@ pub fn setupErrorReturnTrace(sema: *Sema, block: *Block, last_arg_index: usize)
22522252 });
22532253 const addrs_ptr = try err_trace_block.addTy(.alloc, try pt.singleMutPtrType(addr_arr_ty));
22542254
2255 // var st: StackTrace = undefined;
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));
2255 const error_return_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .ErrorReturnTrace);
2256 const st_ptr = try err_trace_block.addTy(.alloc, try pt.singleMutPtrType(error_return_trace_ty));
22582257
22592258 // st.instruction_addresses = &addrs;
22602259 const instruction_addresses_field_name = try ip.getOrPutString(gpa, io, pt.tid, "instruction_addresses", .no_embedded_nulls);
......@@ -6166,10 +6165,10 @@ pub fn analyzeSaveErrRetIndex(sema: *Sema, block: *Block) SemaError!Air.Inst.Ref
61666165
61676166 if (!block.ownerModule().error_tracing) return .none;
61686167
6169 const stack_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .StackTrace);
6168 const error_return_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .ErrorReturnTrace);
61706169 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);
6171 const field_index = sema.structFieldIndex(block, stack_trace_ty, field_name, LazySrcLoc.unneeded) catch |err| switch (err) {
6172 error.AnalysisFail => @panic("std.builtin.StackTrace is corrupt"),
6170 const field_index = sema.structFieldIndex(block, error_return_trace_ty, field_name, LazySrcLoc.unneeded) catch |err| switch (err) {
6171 error.AnalysisFail => @panic("std.builtin.ErrorReturnTrace is corrupt"),
61736172 error.ComptimeReturn, error.ComptimeBreak => unreachable,
61746173 error.OutOfMemory, error.Canceled => |e| return e,
61756174 };
......@@ -6177,7 +6176,7 @@ pub fn analyzeSaveErrRetIndex(sema: *Sema, block: *Block) SemaError!Air.Inst.Ref
61776176 return try block.addInst(.{
61786177 .tag = .save_err_return_trace_index,
61796178 .data = .{ .ty_pl = .{
6180 .ty = Air.internedToRef(stack_trace_ty.toIntern()),
6179 .ty = Air.internedToRef(error_return_trace_ty.toIntern()),
61816180 .payload = @intCast(field_index),
61826181 } },
61836182 });
......@@ -6209,11 +6208,11 @@ fn popErrorReturnTrace(
62096208 // AstGen determined this result does not go to an error-handling expr (try/catch/return etc.), or
62106209 // the result is comptime-known to be a non-error. Either way, pop unconditionally.
62116210
6212 const stack_trace_ty = try sema.getBuiltinType(src, .StackTrace);
6213 const ptr_stack_trace_ty = try pt.singleMutPtrType(stack_trace_ty);
6214 const err_return_trace = try block.addTy(.err_return_trace, ptr_stack_trace_ty);
6211 const error_return_trace_ty = try sema.getBuiltinType(src, .ErrorReturnTrace);
6212 const ptr_error_return_trace_ty = try pt.singleMutPtrType(error_return_trace_ty);
6213 const err_return_trace = try block.addTy(.err_return_trace, ptr_error_return_trace_ty);
62156214 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);
6216 const field_ptr = try sema.structFieldPtr(block, src, err_return_trace, field_name, src, stack_trace_ty);
6215 const field_ptr = try sema.structFieldPtr(block, src, err_return_trace, field_name, src, error_return_trace_ty);
62176216 try sema.storePtr2(block, src, field_ptr, src, saved_error_trace_index, src, .store);
62186217 } else if (is_non_error == null) {
62196218 // The result might be an error. If it is, we leave the error trace alone. If it isn't, we need
......@@ -6234,11 +6233,11 @@ fn popErrorReturnTrace(
62346233 defer then_block.instructions.deinit(gpa);
62356234
62366235 // If non-error, then pop the error return trace by restoring the index.
6237 const stack_trace_ty = try sema.getBuiltinType(src, .StackTrace);
6238 const ptr_stack_trace_ty = try pt.singleMutPtrType(stack_trace_ty);
6239 const err_return_trace = try then_block.addTy(.err_return_trace, ptr_stack_trace_ty);
6236 const error_return_trace_ty = try sema.getBuiltinType(src, .ErrorReturnTrace);
6237 const ptr_error_return_trace_ty = try pt.singleMutPtrType(error_return_trace_ty);
6238 const err_return_trace = try then_block.addTy(.err_return_trace, ptr_error_return_trace_ty);
62406239 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);
6241 const field_ptr = try sema.structFieldPtr(&then_block, src, err_return_trace, field_name, src, stack_trace_ty);
6240 const field_ptr = try sema.structFieldPtr(&then_block, src, err_return_trace, field_name, src, error_return_trace_ty);
62426241 try sema.storePtr2(&then_block, src, field_ptr, src, saved_error_trace_index, src, .store);
62436242 _ = try then_block.addBr(cond_block_inst, .void_value);
62446243
......@@ -6373,15 +6372,15 @@ fn zirCall(
63736372 // If any input is an error-type, we might need to pop any trace it generated. Otherwise, we only
63746373 // need to clean-up our own trace if we were passed to a non-error-handling expression.
63756374 if (input_is_error or (pop_error_return_trace and return_ty.isError(zcu))) {
6376 const stack_trace_ty = try sema.getBuiltinType(call_src, .StackTrace);
6375 const error_return_trace_ty = try sema.getBuiltinType(call_src, .ErrorReturnTrace);
63776376 const field_name = try zcu.intern_pool.getOrPutString(gpa, io, pt.tid, "index", .no_embedded_nulls);
6378 const field_index = try sema.structFieldIndex(block, stack_trace_ty, field_name, call_src);
6377 const field_index = try sema.structFieldIndex(block, error_return_trace_ty, field_name, call_src);
63796378
63806379 // Insert a save instruction before the arg resolution + call instructions we just generated
63816380 const save_inst = try block.insertInst(block_index, .{
63826381 .tag = .save_err_return_trace_index,
63836382 .data = .{ .ty_pl = .{
6384 .ty = Air.internedToRef(stack_trace_ty.toIntern()),
6383 .ty = Air.internedToRef(error_return_trace_ty.toIntern()),
63856384 .payload = @intCast(field_index),
63866385 } },
63876386 });
......@@ -19529,13 +19528,13 @@ fn getErrorReturnTrace(sema: *Sema, block: *Block) CompileError!Air.Inst.Ref {
1952919528 const pt = sema.pt;
1953019529 const zcu = pt.zcu;
1953119530 const ip = &zcu.intern_pool;
19532 const stack_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .StackTrace);
19533 const ptr_stack_trace_ty = try pt.singleMutPtrType(stack_trace_ty);
19534 const opt_ptr_stack_trace_ty = try pt.optionalType(ptr_stack_trace_ty.toIntern());
19531 const error_return_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .ErrorReturnTrace);
19532 const ptr_error_return_trace_ty = try pt.singleMutPtrType(error_return_trace_ty);
19533 const opt_ptr_error_return_trace_ty = try pt.optionalType(ptr_error_return_trace_ty.toIntern());
1953519534
1953619535 switch (sema.owner.unwrap()) {
1953719536 .func => |func| if (ip.funcAnalysisUnordered(func).has_error_trace and block.ownerModule().error_tracing) {
19538 return block.addTy(.err_return_trace, opt_ptr_stack_trace_ty);
19537 return block.addTy(.err_return_trace, opt_ptr_error_return_trace_ty);
1953919538 },
1954019539
1954119540 .@"comptime",
......@@ -19547,7 +19546,7 @@ fn getErrorReturnTrace(sema: *Sema, block: *Block) CompileError!Air.Inst.Ref {
1954719546 => {},
1954819547 }
1954919548 return Air.internedToRef(try pt.intern(.{ .opt = .{
19550 .ty = opt_ptr_stack_trace_ty.toIntern(),
19549 .ty = opt_ptr_error_return_trace_ty.toIntern(),
1955119550 .val = .none,
1955219551 } }));
1955319552}
src/Zcu.zig+2-2
......@@ -434,7 +434,7 @@ pub const BuiltinDecl = enum {
434434 AddressSpace,
435435 CallingConvention,
436436 returnError,
437 StackTrace,
437 ErrorReturnTrace,
438438 SourceLocation,
439439 CallModifier,
440440 AtomicOrder,
......@@ -512,7 +512,7 @@ pub const BuiltinDecl = enum {
512512 return switch (decl) {
513513 .returnError => .func,
514514
515 .StackTrace,
515 .ErrorReturnTrace,
516516 .CallingConvention,
517517 .SourceLocation,
518518 .Signedness,
src/codegen/llvm.zig+1-1
......@@ -3374,7 +3374,7 @@ pub const Object = struct {
33743374 }
33753375
33763376 if (fn_info.cc == .auto and zcu.comp.config.any_error_tracing) {
3377 // First parameter is a pointer to `std.builtin.StackTrace`.
3377 // First parameter is a pointer to `std.builtin.ErrorReturnTrace`.
33783378 const llvm_ptr_ty = try o.builder.ptrType(toLlvmAddressSpace(.generic, target));
33793379 try llvm_params.append(o.gpa, llvm_ptr_ty);
33803380 }
test/cases/compile_errors/panic_has_source_location.zig+1-1
......@@ -6,7 +6,7 @@ export fn foo() void {
66 @panic("oh no");
77}
88
9pub fn panic(_: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
9pub fn panic(_: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {
1010 @compileError("panic");
1111}
1212
test/cases/disable_stack_tracing.zig+1-1
......@@ -13,7 +13,7 @@ pub fn main() !void {
1313
1414 try stdout.interface.flush();
1515}
16fn foo(w: *std.Io.Writer, st_buf: []usize) !std.builtin.StackTrace {
16fn foo(w: *std.Io.Writer, st_buf: []usize) !std.debug.StackTrace {
1717 try std.debug.writeCurrentStackTrace(.{}, .{ .writer = w, .mode = .no_color });
1818 return std.debug.captureCurrentStackTrace(.{}, st_buf);
1919}
test/cases/safety/@alignCast misaligned.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "incorrect alignment")) {
66 std.process.exit(0);
test/cases/safety/@enumFromInt - no matching tag value.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "invalid enum value")) {
66 std.process.exit(0);
test/cases/safety/@enumFromInt truncated bits - exhaustive.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 if (std.mem.eql(u8, message, "invalid enum value")) {
55 std.process.exit(0);
66 }
test/cases/safety/@enumFromInt truncated bits - nonexhaustive.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 if (std.mem.eql(u8, message, "invalid enum value")) {
55 std.process.exit(0);
66 }
test/cases/safety/@errorCast error not present in destination.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "invalid error code")) {
66 std.process.exit(0);
test/cases/safety/@errorCast error union casted to disjoint set.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "invalid error code")) {
66 std.process.exit(0);
test/cases/safety/@intCast to u0.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
66 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - i0 max.zig +1-1
......@@ -1,5 +1,5 @@
11const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
33 _ = stack_trace;
44 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
55 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - i0 min.zig +1-1
......@@ -1,5 +1,5 @@
11const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
33 _ = stack_trace;
44 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
55 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - signed max.zig +1-1
......@@ -1,5 +1,5 @@
11const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
33 _ = stack_trace;
44 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
55 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - signed min.zig +1-1
......@@ -1,5 +1,5 @@
11const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
33 _ = stack_trace;
44 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
55 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - u0 max.zig +1-1
......@@ -1,5 +1,5 @@
11const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
33 _ = stack_trace;
44 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
55 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - u0 min.zig +1-1
......@@ -1,5 +1,5 @@
11const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
33 _ = stack_trace;
44 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
55 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - unsigned max.zig +1-1
......@@ -1,5 +1,5 @@
11const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
33 _ = stack_trace;
44 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
55 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - unsigned min.zig +1-1
......@@ -1,5 +1,5 @@
11const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
33 _ = stack_trace;
44 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
55 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - vector max.zig +1-1
......@@ -1,5 +1,5 @@
11const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
33 _ = stack_trace;
44 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
55 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - boundary case - vector min.zig +1-1
......@@ -1,5 +1,5 @@
11const std = @import("std");
2pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
2pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
33 _ = stack_trace;
44 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
55 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - negative out of range.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
66 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - negative to unsigned.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
66 std.process.exit(0);
test/cases/safety/@intFromFloat cannot fit - positive out of range.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
66 std.process.exit(0);
test/cases/safety/@ptrFromInt address zero to non-optional byte-aligned pointer.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {
66 std.process.exit(0);
test/cases/safety/@ptrFromInt address zero to non-optional pointer.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {
66 std.process.exit(0);
test/cases/safety/@ptrFromInt with misaligned address.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "incorrect alignment")) {
66 std.process.exit(0);
test/cases/safety/@tagName on corrupted enum value.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "invalid enum value")) {
66 std.process.exit(0);
test/cases/safety/@tagName on corrupted union value.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "invalid enum value")) {
66 std.process.exit(0);
test/cases/safety/array slice sentinel mismatch vector.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "sentinel mismatch: expected { 0, 0 }, found { 4, 4 }")) {
66 std.process.exit(0);
test/cases/safety/array slice sentinel mismatch.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) {
66 std.process.exit(0);
test/cases/safety/bad union field access.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "access of union field 'float' while field 'int' is active")) {
66 std.process.exit(0);
test/cases/safety/calling panic.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "oh no")) {
66 std.process.exit(0);
test/cases/safety/cast []u8 to bigger slice of wrong size.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "exact division produced remainder")) {
66 std.process.exit(0);
test/cases/safety/cast integer to global error and no code matches.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "invalid error code")) {
66 std.process.exit(0);
test/cases/safety/empty slice with sentinel out of bounds.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "index out of bounds: index 1, len 0")) {
66 std.process.exit(0);
test/cases/safety/exact division failure - vectors.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "exact division produced remainder")) {
66 std.process.exit(0);
test/cases/safety/exact division failure.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "exact division produced remainder")) {
66 std.process.exit(0);
test/cases/safety/for_len_mismatch.zig+1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "for loop over objects with non-equal lengths")) {
66 std.process.exit(0);
test/cases/safety/for_len_mismatch_three.zig+1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "for loop over objects with non-equal lengths")) {
66 std.process.exit(0);
test/cases/safety/ignored expression integer overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/integer addition overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/integer division by zero - vectors.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "division by zero")) {
66 std.process.exit(0);
test/cases/safety/integer division by zero.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "division by zero")) {
66 std.process.exit(0);
test/cases/safety/integer multiplication overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/integer negation overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/integer subtraction overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/memcpy_alias.zig+1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "@memcpy arguments alias")) {
66 std.process.exit(0);
test/cases/safety/memcpy_len_mismatch.zig+1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "source and destination arguments have non-equal lengths")) {
66 std.process.exit(0);
test/cases/safety/memmove_len_mismatch.zig+1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "source and destination arguments have non-equal lengths")) {
66 std.process.exit(0);
test/cases/safety/memset_array_undefined_bytes.zig+1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/memset_array_undefined_large.zig+1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/memset_slice_undefined_bytes.zig+1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/memset_slice_undefined_large.zig+1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/modrem by zero.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "division by zero")) {
66 std.process.exit(0);
test/cases/safety/modulus by zero.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "division by zero")) {
66 std.process.exit(0);
test/cases/safety/noreturn returned.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "'noreturn' function returned")) {
66 std.process.exit(0);
test/cases/safety/optional unwrap operator on C pointer.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "attempt to use null value")) {
66 std.process.exit(0);
test/cases/safety/optional unwrap operator on null pointer.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "attempt to use null value")) {
66 std.process.exit(0);
test/cases/safety/optional_empty_error_set.zig+1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, ra: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, ra: ?usize) noreturn {
44 _ = stack_trace;
55 _ = ra;
66 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 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "index out of bounds: index 16, len 5")) {
66 std.process.exit(0);
test/cases/safety/out of bounds slice access.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "index out of bounds: index 4, len 4")) {
66 std.process.exit(0);
test/cases/safety/pointer casting null to non-optional pointer.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {
66 std.process.exit(0);
test/cases/safety/pointer casting to null function pointer.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "cast causes pointer to be null")) {
66 std.process.exit(0);
test/cases/safety/pointer slice sentinel mismatch.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) {
66 std.process.exit(0);
test/cases/safety/remainder division by zero.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "division by zero")) {
66 std.process.exit(0);
test/cases/safety/shift left by huge amount.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "shift amount is greater than the type size")) {
66 std.process.exit(0);
test/cases/safety/shift right by huge amount.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "shift amount is greater than the type size")) {
66 std.process.exit(0);
test/cases/safety/signed integer division overflow - vectors.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/signed integer division overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/signed integer not fitting in cast to unsigned integer - widening.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
66 std.process.exit(0);
test/cases/safety/signed integer not fitting in cast to unsigned integer.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
66 std.process.exit(0);
test/cases/safety/signed shift left overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "left shift overflowed bits")) {
66 std.process.exit(0);
test/cases/safety/signed shift right overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "right shift overflowed bits")) {
66 std.process.exit(0);
test/cases/safety/signed-unsigned vector cast.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
66 std.process.exit(0);
test/cases/safety/slice by length sentinel mismatch on lhs.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "sentinel mismatch: expected 1, found 3")) {
66 std.process.exit(0);
test/cases/safety/slice by length sentinel mismatch on rhs.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "sentinel mismatch: expected 1, found 0")) {
66 std.process.exit(0);
test/cases/safety/slice sentinel mismatch - floats.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "sentinel mismatch: expected 1.2, found 4")) {
66 std.process.exit(0);
test/cases/safety/slice sentinel mismatch - optional pointers.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "sentinel mismatch: expected null, found i32@10")) {
66 std.process.exit(0);
test/cases/safety/slice slice sentinel mismatch.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) {
66 std.process.exit(0);
test/cases/safety/slice start index greater than end index.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "start index 10 is larger than end index 1")) {
66 std.process.exit(0);
test/cases/safety/slice with sentinel out of bounds - runtime len.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) {
66 std.process.exit(0);
test/cases/safety/slice with sentinel out of bounds.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) {
66 std.process.exit(0);
test/cases/safety/slice_cast_change_len_0.zig+1-1
......@@ -13,7 +13,7 @@ pub fn main() void {
1313 std.process.exit(1);
1414}
1515
16pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
16pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {
1717 if (std.mem.eql(u8, message, "slice length '3' does not divide exactly into destination elements")) {
1818 std.process.exit(0);
1919 }
test/cases/safety/slice_cast_change_len_1.zig+1-1
......@@ -13,7 +13,7 @@ pub fn main() void {
1313 std.process.exit(1);
1414}
1515
16pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
16pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {
1717 if (std.mem.eql(u8, message, "slice length '1' does not divide exactly into destination elements")) {
1818 std.process.exit(0);
1919 }
test/cases/safety/slice_cast_change_len_2.zig+1-1
......@@ -13,7 +13,7 @@ pub fn main() void {
1313 std.process.exit(1);
1414}
1515
16pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
16pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn {
1717 if (std.mem.eql(u8, message, "slice length '1' does not divide exactly into destination elements")) {
1818 std.process.exit(0);
1919 }
test/cases/safety/slicing null C pointer - runtime len.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "attempt to use null value")) {
66 std.process.exit(0);
test/cases/safety/slicing null C pointer.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "attempt to use null value")) {
66 std.process.exit(0);
test/cases/safety/switch else on corrupt enum value - one prong.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "switch on corrupt value")) {
66 std.process.exit(0);
test/cases/safety/switch else on corrupt enum value - union.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "switch on corrupt value")) {
66 std.process.exit(0);
test/cases/safety/switch else on corrupt enum value.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "switch on corrupt value")) {
66 std.process.exit(0);
test/cases/safety/switch on corrupted enum value.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "switch on corrupt value")) {
66 std.process.exit(0);
test/cases/safety/switch on corrupted union value.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "switch on corrupt value")) {
66 std.process.exit(0);
test/cases/safety/truncating vector cast.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
66 std.process.exit(0);
test/cases/safety/unreachable.zig+1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "reached unreachable code")) {
66 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 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
66 std.process.exit(0);
test/cases/safety/unsigned shift left overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "left shift overflowed bits")) {
66 std.process.exit(0);
test/cases/safety/unsigned shift right overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "right shift overflowed bits")) {
66 std.process.exit(0);
test/cases/safety/unsigned-signed vector cast.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
66 std.process.exit(0);
test/cases/safety/unwrap error switch.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "attempt to unwrap error: Whatever")) {
66 std.process.exit(0);
test/cases/safety/unwrap error.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "attempt to unwrap error: Whatever")) {
66 std.process.exit(0);
test/cases/safety/value does not fit in shortening cast - u0.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
66 std.process.exit(0);
test/cases/safety/value does not fit in shortening cast.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
66 std.process.exit(0);
test/cases/safety/vector integer addition overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/vector integer multiplication overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/vector integer negation overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/vector integer subtraction overflow.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "integer overflow")) {
66 std.process.exit(0);
test/cases/safety/zero casted to error.zig +1-1
......@@ -1,6 +1,6 @@
11const std = @import("std");
22
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
3pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn {
44 _ = stack_trace;
55 if (std.mem.eql(u8, message, "invalid error code")) {
66 std.process.exit(0);
test/cases/tail_call_noreturn.zig+2-2
......@@ -1,9 +1,9 @@
11const std = @import("std");
22const builtin = std.builtin;
3pub fn foo(message: []const u8, stack_trace: ?*builtin.StackTrace) noreturn {
3pub fn foo(message: []const u8, stack_trace: ?*std.debug.StackTrace) noreturn {
44 @call(.always_tail, bar, .{ message, stack_trace });
55}
6pub fn bar(message: []const u8, stack_trace: ?*builtin.StackTrace) noreturn {
6pub fn bar(message: []const u8, stack_trace: ?*std.debug.StackTrace) noreturn {
77 _ = message;
88 _ = stack_trace;
99 std.process.exit(0);
test/stack_traces.zig+9-9
......@@ -118,13 +118,13 @@ pub fn addCases(cases: *@import("tests.zig").StackTracesContext) void {
118118 \\ var stack_trace_buf: [8]usize = undefined;
119119 \\ dumpIt(&captureIt(&stack_trace_buf));
120120 \\}
121 \\fn captureIt(buf: []usize) std.builtin.StackTrace {
121 \\fn captureIt(buf: []usize) std.debug.StackTrace {
122122 \\ return captureItInner(buf);
123123 \\}
124 \\fn dumpIt(st: *const std.builtin.StackTrace) void {
124 \\fn dumpIt(st: *const std.debug.StackTrace) void {
125125 \\ std.debug.dumpStackTrace(st);
126126 \\}
127 \\fn captureItInner(buf: []usize) std.builtin.StackTrace {
127 \\fn captureItInner(buf: []usize) std.debug.StackTrace {
128128 \\ return std.debug.captureCurrentStackTrace(.{}, buf);
129129 \\}
130130 \\const std = @import("std");
......@@ -159,13 +159,13 @@ pub fn addCases(cases: *@import("tests.zig").StackTracesContext) void {
159159 \\ var stack_trace_buf: [8]usize = undefined;
160160 \\ dumpIt(&captureIt(&stack_trace_buf));
161161 \\}
162 \\fn captureIt(buf: []usize) std.builtin.StackTrace {
162 \\fn captureIt(buf: []usize) std.debug.StackTrace {
163163 \\ return captureItInner(buf);
164164 \\}
165 \\fn dumpIt(st: *const std.builtin.StackTrace) void {
165 \\fn dumpIt(st: *const std.debug.StackTrace) void {
166166 \\ std.debug.dumpStackTrace(st);
167167 \\}
168 \\fn captureItInner(buf: []usize) std.builtin.StackTrace {
168 \\fn captureItInner(buf: []usize) std.debug.StackTrace {
169169 \\ return std.debug.captureCurrentStackTrace(.{}, buf);
170170 \\}
171171 \\const std = @import("std");
......@@ -188,13 +188,13 @@ pub fn addCases(cases: *@import("tests.zig").StackTracesContext) void {
188188 \\fn threadMain(stack_trace_buf: []usize) void {
189189 \\ dumpIt(&captureIt(stack_trace_buf));
190190 \\}
191 \\fn captureIt(buf: []usize) std.builtin.StackTrace {
191 \\fn captureIt(buf: []usize) std.debug.StackTrace {
192192 \\ return captureItInner(buf);
193193 \\}
194 \\fn dumpIt(st: *const std.builtin.StackTrace) void {
194 \\fn dumpIt(st: *const std.debug.StackTrace) void {
195195 \\ std.debug.dumpStackTrace(st);
196196 \\}
197 \\fn captureItInner(buf: []usize) std.builtin.StackTrace {
197 \\fn captureItInner(buf: []usize) std.debug.StackTrace {
198198 \\ return std.debug.captureCurrentStackTrace(.{}, buf);
199199 \\}
200200 \\const std = @import("std");
test/standalone/compile_asm/main.zig+1-1
......@@ -4,7 +4,7 @@ export fn main(r0: u32, r1: u32, atags: u32) callconv(.c) noreturn {
44 _ = atags;
55 unreachable; // never gets run so it doesn't matter
66}
7pub fn panic(msg: []const u8, error_return_trace: ?*@import("std").builtin.StackTrace, _: ?usize) noreturn {
7pub fn panic(msg: []const u8, error_return_trace: ?*@import("std").debug.StackTrace, _: ?usize) noreturn {
88 _ = msg;
99 _ = error_return_trace;
1010 while (true) {}
test/standalone/issue_339/test.zig+1-1
......@@ -1,4 +1,4 @@
1const StackTrace = @import("std").builtin.StackTrace;
1const StackTrace = @import("std").debug.StackTrace;
22pub fn panic(msg: []const u8, stack_trace: ?*StackTrace, _: ?usize) noreturn {
33 _ = msg;
44 _ = stack_trace;
test/tests.zig+1-1
......@@ -2200,7 +2200,7 @@ pub fn addCliTests(b: *std.Build) *Step {
22002200 \\ return num * num;
22012201 \\}
22022202 \\extern fn zig_panic() noreturn;
2203 \\pub fn panic(msg: []const u8, error_return_trace: ?*@import("std").builtin.StackTrace, _: ?usize) noreturn {
2203 \\pub fn panic(msg: []const u8, error_return_trace: ?*@import("std").debug.StackTrace, _: ?usize) noreturn {
22042204 \\ _ = msg;
22052205 \\ _ = error_return_trace;
22062206 \\ zig_panic();