| author | |
| committer | |
| log | 94ff38af87e9784fc78ad3186553c953860659c4 |
| tree | 603ab10f0ca97fe8827029ee870f2f144799243c |
| parent | cc15c8ae7e0b8d994e818f8275bf73617edefe68 |
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 |
| 4900 | 4900 | {#header_close#} |
| 4901 | 4901 | |
| 4902 | 4902 | {#header_open|@errorReturnTrace#} |
| 4903 | <pre>{#syntax#}@errorReturnTrace() ?*builtin.StackTrace{#endsyntax#}</pre> | |
| 4903 | <pre>{#syntax#}@errorReturnTrace() ?*builtin.ErrorReturnTrace{#endsyntax#}</pre> | |
| 4904 | 4904 | <p> |
| 4905 | 4905 | If the binary is built with error return tracing, and this function is invoked in a |
| 4906 | 4906 | 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 | 40 | .logFn = logFn, |
| 41 | 41 | }; |
| 42 | 42 | |
| 43 | pub fn panic(msg: []const u8, st: ?*std.builtin.StackTrace, addr: ?usize) noreturn { | |
| 43 | pub fn panic(msg: []const u8, st: ?*std.debug.StackTrace, addr: ?usize) noreturn { | |
| 44 | 44 | _ = st; |
| 45 | 45 | _ = addr; |
| 46 | 46 | log.err("panic: {s}", .{msg}); |
lib/docs/wasm/main.zig+1-1| ... | ... | @@ -33,7 +33,7 @@ pub const std_options: std.Options = .{ |
| 33 | 33 | //.log_level = .debug, |
| 34 | 34 | }; |
| 35 | 35 | |
| 36 | pub fn panic(msg: []const u8, st: ?*std.builtin.StackTrace, addr: ?usize) noreturn { | |
| 36 | pub fn panic(msg: []const u8, st: ?*std.debug.StackTrace, addr: ?usize) noreturn { | |
| 37 | 37 | _ = st; |
| 38 | 38 | _ = addr; |
| 39 | 39 | log.err("panic: {s}", .{msg}); |
lib/std/Build/Step.zig+1-1| ... | ... | @@ -67,7 +67,7 @@ test_results: TestResults, |
| 67 | 67 | |
| 68 | 68 | /// The return address associated with creation of this step that can be useful |
| 69 | 69 | /// to print along with debugging messages. |
| 70 | debug_stack_trace: std.builtin.StackTrace, | |
| 70 | debug_stack_trace: std.debug.StackTrace, | |
| 71 | 71 | |
| 72 | 72 | pub const TestResults = struct { |
| 73 | 73 | /// 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"); |
| 8 | 8 | |
| 9 | 9 | /// This data structure is used by the Zig language code generation and |
| 10 | 10 | /// therefore must be kept in sync with the compiler implementation. |
| 11 | pub const StackTrace = struct { | |
| 11 | pub const ErrorReturnTrace = struct { | |
| 12 | 12 | index: usize, |
| 13 | 13 | 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, | |
| 17 | 14 | }; |
| 18 | 15 | |
| 19 | 16 | /// 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; |
| 13 | 13 | const builtin = @import("builtin"); |
| 14 | 14 | const native_arch = builtin.cpu.arch; |
| 15 | 15 | const native_os = builtin.os.tag; |
| 16 | const StackTrace = std.builtin.StackTrace; | |
| 17 | 16 | |
| 18 | 17 | const root = @import("root"); |
| 19 | 18 | |
| ... | ... | @@ -568,7 +567,7 @@ pub fn defaultPanic(msg: []const u8, first_trace_addr: ?usize) noreturn { |
| 568 | 567 | |
| 569 | 568 | if (@errorReturnTrace()) |t| if (t.index > 0) { |
| 570 | 569 | writer.writeAll("error return context:\n") catch break :trace; |
| 571 | writeStackTrace(t, stderr) catch break :trace; | |
| 570 | writeErrorReturnTrace(t, stderr) catch break :trace; | |
| 572 | 571 | writer.writeAll("\nstack trace:\n") catch break :trace; |
| 573 | 572 | }; |
| 574 | 573 | writeCurrentStackTrace(.{ |
| ... | ... | @@ -607,6 +606,13 @@ fn waitForOtherThreadToFinishPanicking() void { |
| 607 | 606 | } |
| 608 | 607 | } |
| 609 | 608 | |
| 609 | /// This data structure is used by the Zig language code generation and | |
| 610 | /// therefore must be kept in sync with the compiler implementation. | |
| 611 | pub const StackTrace = struct { | |
| 612 | index: usize, | |
| 613 | instruction_addresses: []usize, | |
| 614 | }; | |
| 615 | ||
| 610 | 616 | pub const StackUnwindOptions = struct { |
| 611 | 617 | /// If not `null`, we will ignore all frames up until this return address. This is typically |
| 612 | 618 | /// 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: |
| 629 | 635 | const empty_trace: StackTrace = .{ |
| 630 | 636 | .index = 0, |
| 631 | 637 | .instruction_addresses = &.{}, |
| 632 | .includes_inlined_frames = false, | |
| 633 | 638 | }; |
| 634 | 639 | if (!std.options.allow_stack_tracing) return empty_trace; |
| 635 | 640 | var it: StackIterator = .init(options.context); |
| ... | ... | @@ -665,7 +670,6 @@ pub noinline fn captureCurrentStackTrace(options: StackUnwindOptions, addr_buf: |
| 665 | 670 | return .{ |
| 666 | 671 | .index = index, |
| 667 | 672 | .instruction_addresses = addr_buf[0..index], |
| 668 | .includes_inlined_frames = false, | |
| 669 | 673 | }; |
| 670 | 674 | } |
| 671 | 675 | /// Write the current stack trace to `writer`, annotated with source locations. |
| ... | ... | @@ -752,7 +756,7 @@ pub noinline fn writeCurrentStackTrace(options: StackUnwindOptions, t: Io.Termin |
| 752 | 756 | // Subtract 1 to get an address *in* the function call for a better source location. |
| 753 | 757 | try printSourceAtAddress(io, di, t, .{ |
| 754 | 758 | .address = ret_addr -| StackIterator.ra_call_offset, |
| 755 | .print_inlines = true, | |
| 759 | .resolve_inline_callers = true, | |
| 756 | 760 | }); |
| 757 | 761 | printed_any_frame = true; |
| 758 | 762 | }, |
| ... | ... | @@ -786,8 +790,17 @@ pub const FormatStackTrace = struct { |
| 786 | 790 | } |
| 787 | 791 | }; |
| 788 | 792 | |
| 793 | /// Write a previously captured error return trace to `writer`, annotated with source locations. | |
| 794 | pub fn writeErrorReturnTrace(st: *const std.builtin.ErrorReturnTrace, t: Io.Terminal) Writer.Error!void { | |
| 795 | try writeTrace(st, t, false); | |
| 796 | } | |
| 797 | ||
| 789 | 798 | /// Write a previously captured stack trace to `writer`, annotated with source locations. |
| 790 | pub fn writeStackTrace(st: *const StackTrace, t: Io.Terminal) Writer.Error!void { | |
| 799 | pub fn writeStackTrace(et: *const StackTrace, t: Io.Terminal) Writer.Error!void { | |
| 800 | try writeTrace(et, t, true); | |
| 801 | } | |
| 802 | ||
| 803 | fn writeTrace(trace: anytype, t: Io.Terminal, resolve_inline_callers: bool) Writer.Error!void { | |
| 791 | 804 | const writer = t.writer; |
| 792 | 805 | if (!std.options.allow_stack_tracing) { |
| 793 | 806 | t.setColor(.dim) catch {}; |
| ... | ... | @@ -796,9 +809,9 @@ pub fn writeStackTrace(st: *const StackTrace, t: Io.Terminal) Writer.Error!void |
| 796 | 809 | return; |
| 797 | 810 | } |
| 798 | 811 | |
| 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; | |
| 802 | 815 | if (n_frames == 0) return writer.writeAll("(empty stack trace)\n"); |
| 803 | 816 | const di = getSelfDebugInfo() catch |err| switch (err) { |
| 804 | 817 | error.UnsupportedTarget => { |
| ... | ... | @@ -809,13 +822,13 @@ pub fn writeStackTrace(st: *const StackTrace, t: Io.Terminal) Writer.Error!void |
| 809 | 822 | }, |
| 810 | 823 | }; |
| 811 | 824 | 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| { | |
| 814 | 827 | // `ret_addr` is the return address, which is *after* the function call. |
| 815 | 828 | // Subtract 1 to get an address *in* the function call for a better source location. |
| 816 | 829 | try printSourceAtAddress(io, di, t, .{ |
| 817 | 830 | .address = ret_addr -| StackIterator.ra_call_offset, |
| 818 | .print_inlines = !st.includes_inlined_frames, | |
| 831 | .resolve_inline_callers = resolve_inline_callers, | |
| 819 | 832 | }); |
| 820 | 833 | } |
| 821 | 834 | if (n_frames > captured_frames) { |
| ... | ... | @@ -833,6 +846,15 @@ pub fn dumpStackTrace(st: *const StackTrace) void { |
| 833 | 846 | }; |
| 834 | 847 | } |
| 835 | 848 | |
| 849 | /// A thin wrapper around `writeErrorReturnTrace` which writes to stderr and ignores write errors. | |
| 850 | pub 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 | ||
| 836 | 858 | const StackIterator = union(enum) { |
| 837 | 859 | /// We will first report the current PC of this `CpuContextPtr`, then we will switch to a |
| 838 | 860 | /// different strategy to actually unwind. |
| ... | ... | @@ -1124,7 +1146,7 @@ pub inline fn stripInstructionPtrAuthCode(ptr: usize) usize { |
| 1124 | 1146 | |
| 1125 | 1147 | const PrintSourceAddressOptions = struct { |
| 1126 | 1148 | address: usize, |
| 1127 | print_inlines: bool, | |
| 1149 | resolve_inline_callers: bool, | |
| 1128 | 1150 | }; |
| 1129 | 1151 | |
| 1130 | 1152 | fn printSourceAtAddress( |
| ... | ... | @@ -1163,7 +1185,7 @@ fn printSourceAtAddress( |
| 1163 | 1185 | symbol.name orelse "???", |
| 1164 | 1186 | symbol.compile_unit_name orelse debug_info.getModuleName(io, options.address) catch "???", |
| 1165 | 1187 | ); |
| 1166 | if (!options.print_inlines) break; | |
| 1188 | if (!options.resolve_inline_callers) break; | |
| 1167 | 1189 | } |
| 1168 | 1190 | } |
| 1169 | 1191 | fn printLineInfo( |
| ... | ... | @@ -1708,7 +1730,6 @@ pub fn ConfigurableTrace(comptime size: usize, comptime stack_frame_count: usize |
| 1708 | 1730 | const stack_trace: StackTrace = .{ |
| 1709 | 1731 | .index = frames.len, |
| 1710 | 1732 | .instruction_addresses = frames, |
| 1711 | .includes_inlined_frames = false, | |
| 1712 | 1733 | }; |
| 1713 | 1734 | writeStackTrace(&stack_trace, stderr) catch return; |
| 1714 | 1735 | } |
lib/std/heap/debug_allocator.zig+2-4| ... | ... | @@ -81,7 +81,7 @@ |
| 81 | 81 | //! Resizing and remapping are forwarded directly to the backing allocator, |
| 82 | 82 | //! except where such operations would change the category from large to small. |
| 83 | 83 | const builtin = @import("builtin"); |
| 84 | const StackTrace = std.builtin.StackTrace; | |
| 84 | const StackTrace = std.debug.StackTrace; | |
| 85 | 85 | |
| 86 | 86 | const std = @import("std"); |
| 87 | 87 | const log = std.log.scoped(.DebugAllocator); |
| ... | ... | @@ -229,7 +229,7 @@ pub fn DebugAllocator(comptime config: Config) type { |
| 229 | 229 | std.debug.dumpStackTrace(self.getStackTrace(trace_kind)); |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | fn getStackTrace(self: *LargeAlloc, trace_kind: TraceKind) std.builtin.StackTrace { | |
| 232 | fn getStackTrace(self: *LargeAlloc, trace_kind: TraceKind) std.debug.StackTrace { | |
| 233 | 233 | assert(@intFromEnum(trace_kind) < trace_n); |
| 234 | 234 | const stack_addresses = &self.stack_addresses[@intFromEnum(trace_kind)]; |
| 235 | 235 | var len: usize = 0; |
| ... | ... | @@ -239,7 +239,6 @@ pub fn DebugAllocator(comptime config: Config) type { |
| 239 | 239 | return .{ |
| 240 | 240 | .instruction_addresses = stack_addresses, |
| 241 | 241 | .index = len, |
| 242 | .includes_inlined_frames = false, | |
| 243 | 242 | }; |
| 244 | 243 | } |
| 245 | 244 | |
| ... | ... | @@ -342,7 +341,6 @@ pub fn DebugAllocator(comptime config: Config) type { |
| 342 | 341 | return .{ |
| 343 | 342 | .instruction_addresses = stack_addresses, |
| 344 | 343 | .index = len, |
| 345 | .includes_inlined_frames = false, | |
| 346 | 344 | }; |
| 347 | 345 | } |
| 348 | 346 |
lib/std/start.zig+1-1| ... | ... | @@ -761,7 +761,7 @@ inline fn wrapMain(result: anytype) u8 { |
| 761 | 761 | std.log.err("{t}", .{err}); |
| 762 | 762 | switch (native_os) { |
| 763 | 763 | .freestanding, .other => {}, |
| 764 | else => if (@errorReturnTrace()) |trace| std.debug.dumpStackTrace(trace), | |
| 764 | else => if (@errorReturnTrace()) |trace| std.debug.dumpErrorReturnTrace(trace), | |
| 765 | 765 | } |
| 766 | 766 | return 1; |
| 767 | 767 | }; |
lib/std/testing/FailingAllocator.zig+1-1| ... | ... | @@ -131,7 +131,7 @@ fn free( |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /// Only valid once `has_induced_failure == true` |
| 134 | pub fn getStackTrace(self: *FailingAllocator) std.builtin.StackTrace { | |
| 134 | pub fn getStackTrace(self: *FailingAllocator) std.debug.StackTrace { | |
| 135 | 135 | std.debug.assert(self.has_induced_failure); |
| 136 | 136 | var len: usize = 0; |
| 137 | 137 | 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) |
| 2252 | 2252 | }); |
| 2253 | 2253 | const addrs_ptr = try err_trace_block.addTy(.alloc, try pt.singleMutPtrType(addr_arr_ty)); |
| 2254 | 2254 | |
| 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)); | |
| 2258 | 2257 | |
| 2259 | 2258 | // st.instruction_addresses = &addrs; |
| 2260 | 2259 | 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 |
| 6166 | 6165 | |
| 6167 | 6166 | if (!block.ownerModule().error_tracing) return .none; |
| 6168 | 6167 | |
| 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); | |
| 6170 | 6169 | 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"), | |
| 6173 | 6172 | error.ComptimeReturn, error.ComptimeBreak => unreachable, |
| 6174 | 6173 | error.OutOfMemory, error.Canceled => |e| return e, |
| 6175 | 6174 | }; |
| ... | ... | @@ -6177,7 +6176,7 @@ pub fn analyzeSaveErrRetIndex(sema: *Sema, block: *Block) SemaError!Air.Inst.Ref |
| 6177 | 6176 | return try block.addInst(.{ |
| 6178 | 6177 | .tag = .save_err_return_trace_index, |
| 6179 | 6178 | .data = .{ .ty_pl = .{ |
| 6180 | .ty = Air.internedToRef(stack_trace_ty.toIntern()), | |
| 6179 | .ty = Air.internedToRef(error_return_trace_ty.toIntern()), | |
| 6181 | 6180 | .payload = @intCast(field_index), |
| 6182 | 6181 | } }, |
| 6183 | 6182 | }); |
| ... | ... | @@ -6209,11 +6208,11 @@ fn popErrorReturnTrace( |
| 6209 | 6208 | // AstGen determined this result does not go to an error-handling expr (try/catch/return etc.), or |
| 6210 | 6209 | // the result is comptime-known to be a non-error. Either way, pop unconditionally. |
| 6211 | 6210 | |
| 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); | |
| 6215 | 6214 | 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); | |
| 6217 | 6216 | try sema.storePtr2(block, src, field_ptr, src, saved_error_trace_index, src, .store); |
| 6218 | 6217 | } else if (is_non_error == null) { |
| 6219 | 6218 | // 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( |
| 6234 | 6233 | defer then_block.instructions.deinit(gpa); |
| 6235 | 6234 | |
| 6236 | 6235 | // 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); | |
| 6240 | 6239 | 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); | |
| 6242 | 6241 | try sema.storePtr2(&then_block, src, field_ptr, src, saved_error_trace_index, src, .store); |
| 6243 | 6242 | _ = try then_block.addBr(cond_block_inst, .void_value); |
| 6244 | 6243 | |
| ... | ... | @@ -6373,15 +6372,15 @@ fn zirCall( |
| 6373 | 6372 | // If any input is an error-type, we might need to pop any trace it generated. Otherwise, we only |
| 6374 | 6373 | // need to clean-up our own trace if we were passed to a non-error-handling expression. |
| 6375 | 6374 | 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); | |
| 6377 | 6376 | 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); | |
| 6379 | 6378 | |
| 6380 | 6379 | // Insert a save instruction before the arg resolution + call instructions we just generated |
| 6381 | 6380 | const save_inst = try block.insertInst(block_index, .{ |
| 6382 | 6381 | .tag = .save_err_return_trace_index, |
| 6383 | 6382 | .data = .{ .ty_pl = .{ |
| 6384 | .ty = Air.internedToRef(stack_trace_ty.toIntern()), | |
| 6383 | .ty = Air.internedToRef(error_return_trace_ty.toIntern()), | |
| 6385 | 6384 | .payload = @intCast(field_index), |
| 6386 | 6385 | } }, |
| 6387 | 6386 | }); |
| ... | ... | @@ -19529,13 +19528,13 @@ fn getErrorReturnTrace(sema: *Sema, block: *Block) CompileError!Air.Inst.Ref { |
| 19529 | 19528 | const pt = sema.pt; |
| 19530 | 19529 | const zcu = pt.zcu; |
| 19531 | 19530 | 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()); | |
| 19535 | 19534 | |
| 19536 | 19535 | switch (sema.owner.unwrap()) { |
| 19537 | 19536 | .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); | |
| 19539 | 19538 | }, |
| 19540 | 19539 | |
| 19541 | 19540 | .@"comptime", |
| ... | ... | @@ -19547,7 +19546,7 @@ fn getErrorReturnTrace(sema: *Sema, block: *Block) CompileError!Air.Inst.Ref { |
| 19547 | 19546 | => {}, |
| 19548 | 19547 | } |
| 19549 | 19548 | return Air.internedToRef(try pt.intern(.{ .opt = .{ |
| 19550 | .ty = opt_ptr_stack_trace_ty.toIntern(), | |
| 19549 | .ty = opt_ptr_error_return_trace_ty.toIntern(), | |
| 19551 | 19550 | .val = .none, |
| 19552 | 19551 | } })); |
| 19553 | 19552 | } |
src/Zcu.zig+2-2| ... | ... | @@ -434,7 +434,7 @@ pub const BuiltinDecl = enum { |
| 434 | 434 | AddressSpace, |
| 435 | 435 | CallingConvention, |
| 436 | 436 | returnError, |
| 437 | StackTrace, | |
| 437 | ErrorReturnTrace, | |
| 438 | 438 | SourceLocation, |
| 439 | 439 | CallModifier, |
| 440 | 440 | AtomicOrder, |
| ... | ... | @@ -512,7 +512,7 @@ pub const BuiltinDecl = enum { |
| 512 | 512 | return switch (decl) { |
| 513 | 513 | .returnError => .func, |
| 514 | 514 | |
| 515 | .StackTrace, | |
| 515 | .ErrorReturnTrace, | |
| 516 | 516 | .CallingConvention, |
| 517 | 517 | .SourceLocation, |
| 518 | 518 | .Signedness, |
src/codegen/llvm.zig+1-1| ... | ... | @@ -3374,7 +3374,7 @@ pub const Object = struct { |
| 3374 | 3374 | } |
| 3375 | 3375 | |
| 3376 | 3376 | 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`. | |
| 3378 | 3378 | const llvm_ptr_ty = try o.builder.ptrType(toLlvmAddressSpace(.generic, target)); |
| 3379 | 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 | 6 | @panic("oh no"); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | pub fn panic(_: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 9 | pub fn panic(_: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 10 | 10 | @compileError("panic"); |
| 11 | 11 | } |
| 12 | 12 |
test/cases/disable_stack_tracing.zig+1-1| ... | ... | @@ -13,7 +13,7 @@ pub fn main() !void { |
| 13 | 13 | |
| 14 | 14 | try stdout.interface.flush(); |
| 15 | 15 | } |
| 16 | fn foo(w: *std.Io.Writer, st_buf: []usize) !std.builtin.StackTrace { | |
| 16 | fn foo(w: *std.Io.Writer, st_buf: []usize) !std.debug.StackTrace { | |
| 17 | 17 | try std.debug.writeCurrentStackTrace(.{}, .{ .writer = w, .mode = .no_color }); |
| 18 | 18 | return std.debug.captureCurrentStackTrace(.{}, st_buf); |
| 19 | 19 | } |
test/cases/safety/@alignCast misaligned.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "incorrect alignment")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/@enumFromInt - no matching tag value.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "invalid enum value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/@enumFromInt truncated bits - exhaustive.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | if (std.mem.eql(u8, message, "invalid enum value")) { |
| 5 | 5 | std.process.exit(0); |
| 6 | 6 | } |
test/cases/safety/@enumFromInt truncated bits - nonexhaustive.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | if (std.mem.eql(u8, message, "invalid enum value")) { |
| 5 | 5 | std.process.exit(0); |
| 6 | 6 | } |
test/cases/safety/@errorCast error not present in destination.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "invalid error code")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/@errorCast error union casted to disjoint set.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "invalid error code")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/@intCast to u0.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer does not fit in destination type")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - boundary case - i0 max.zig	+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 3 | 3 | _ = stack_trace; |
| 4 | 4 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 5 | 5 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - boundary case - i0 min.zig	+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 3 | 3 | _ = stack_trace; |
| 4 | 4 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 5 | 5 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - boundary case - signed max.zig	+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 3 | 3 | _ = stack_trace; |
| 4 | 4 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 5 | 5 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - boundary case - signed min.zig	+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 3 | 3 | _ = stack_trace; |
| 4 | 4 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 5 | 5 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - boundary case - u0 max.zig	+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 3 | 3 | _ = stack_trace; |
| 4 | 4 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 5 | 5 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - boundary case - u0 min.zig	+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 3 | 3 | _ = stack_trace; |
| 4 | 4 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 5 | 5 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - boundary case - unsigned max.zig	+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 3 | 3 | _ = stack_trace; |
| 4 | 4 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 5 | 5 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - boundary case - unsigned min.zig	+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 3 | 3 | _ = stack_trace; |
| 4 | 4 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 5 | 5 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - boundary case - vector max.zig	+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 3 | 3 | _ = stack_trace; |
| 4 | 4 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 5 | 5 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - boundary case - vector min.zig	+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 3 | 3 | _ = stack_trace; |
| 4 | 4 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 5 | 5 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - negative out of range.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - negative to unsigned.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/@intFromFloat cannot fit - positive out of range.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 6 | 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 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "cast causes pointer to be null")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/@ptrFromInt address zero to non-optional pointer.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "cast causes pointer to be null")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/@ptrFromInt with misaligned address.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "incorrect alignment")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/@tagName on corrupted enum value.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "invalid enum value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/@tagName on corrupted union value.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "invalid enum value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/array slice sentinel mismatch vector.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "sentinel mismatch: expected { 0, 0 }, found { 4, 4 }")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/array slice sentinel mismatch.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/bad union field access.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "access of union field 'float' while field 'int' is active")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/calling panic.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "oh no")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/cast []u8 to bigger slice of wrong size.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "exact division produced remainder")) { |
| 6 | 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 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "invalid error code")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/empty slice with sentinel out of bounds.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "index out of bounds: index 1, len 0")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/exact division failure - vectors.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "exact division produced remainder")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/exact division failure.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "exact division produced remainder")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/for_len_mismatch.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "for loop over objects with non-equal lengths")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/for_len_mismatch_three.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "for loop over objects with non-equal lengths")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/ignored expression integer overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/integer addition overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/integer division by zero - vectors.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "division by zero")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/integer division by zero.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "division by zero")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/integer multiplication overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/integer negation overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/integer subtraction overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/memcpy_alias.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "@memcpy arguments alias")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/memcpy_len_mismatch.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "source and destination arguments have non-equal lengths")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/memmove_len_mismatch.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "source and destination arguments have non-equal lengths")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/memset_array_undefined_bytes.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/memset_array_undefined_large.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/memset_slice_undefined_bytes.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/memset_slice_undefined_large.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/modrem by zero.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "division by zero")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/modulus by zero.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "division by zero")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/noreturn returned.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "'noreturn' function returned")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/optional unwrap operator on C pointer.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "attempt to use null value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/optional unwrap operator on null pointer.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "attempt to use null value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/optional_empty_error_set.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, ra: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, ra: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | _ = ra; |
| 6 | 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 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "index out of bounds: index 16, len 5")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/out of bounds slice access.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "index out of bounds: index 4, len 4")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/pointer casting null to non-optional pointer.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "cast causes pointer to be null")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/pointer casting to null function pointer.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "cast causes pointer to be null")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/pointer slice sentinel mismatch.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/remainder division by zero.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "division by zero")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/shift left by huge amount.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "shift amount is greater than the type size")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/shift right by huge amount.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "shift amount is greater than the type size")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/signed integer division overflow - vectors.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/signed integer division overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 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 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer does not fit in destination type")) { |
| 6 | 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 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer does not fit in destination type")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/signed shift left overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "left shift overflowed bits")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/signed shift right overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "right shift overflowed bits")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/signed-unsigned vector cast.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer does not fit in destination type")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/slice by length sentinel mismatch on lhs.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "sentinel mismatch: expected 1, found 3")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/slice by length sentinel mismatch on rhs.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "sentinel mismatch: expected 1, found 0")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/slice sentinel mismatch - floats.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "sentinel mismatch: expected 1.2, found 4")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/slice sentinel mismatch - optional pointers.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "sentinel mismatch: expected null, found i32@10")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/slice slice sentinel mismatch.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "sentinel mismatch: expected 0, found 4")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/slice start index greater than end index.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "start index 10 is larger than end index 1")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/slice with sentinel out of bounds - runtime len.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/slice with sentinel out of bounds.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) { |
| 6 | 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 | 13 | std.process.exit(1); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 16 | pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 17 | 17 | if (std.mem.eql(u8, message, "slice length '3' does not divide exactly into destination elements")) { |
| 18 | 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 | 13 | std.process.exit(1); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 16 | pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 17 | 17 | if (std.mem.eql(u8, message, "slice length '1' does not divide exactly into destination elements")) { |
| 18 | 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 | 13 | std.process.exit(1); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | pub fn panic(message: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 16 | pub fn panic(message: []const u8, _: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 17 | 17 | if (std.mem.eql(u8, message, "slice length '1' does not divide exactly into destination elements")) { |
| 18 | 18 | std.process.exit(0); |
| 19 | 19 | } |
test/cases/safety/slicing null C pointer - runtime len.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "attempt to use null value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/slicing null C pointer.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "attempt to use null value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/switch else on corrupt enum value - one prong.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "switch on corrupt value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/switch else on corrupt enum value - union.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "switch on corrupt value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/switch else on corrupt enum value.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "switch on corrupt value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/switch on corrupted enum value.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "switch on corrupt value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/switch on corrupted union value.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "switch on corrupt value")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/truncating vector cast.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer does not fit in destination type")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/unreachable.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "reached unreachable code")) { |
| 6 | 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 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer does not fit in destination type")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/unsigned shift left overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "left shift overflowed bits")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/unsigned shift right overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "right shift overflowed bits")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/unsigned-signed vector cast.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer does not fit in destination type")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/unwrap error switch.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "attempt to unwrap error: Whatever")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/unwrap error.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "attempt to unwrap error: Whatever")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/value does not fit in shortening cast - u0.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer does not fit in destination type")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/value does not fit in shortening cast.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer does not fit in destination type")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/vector integer addition overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/vector integer multiplication overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/vector integer negation overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/vector integer subtraction overflow.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "integer overflow")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/safety/zero casted to error.zig	+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.debug.StackTrace, _: ?usize) noreturn { | |
| 4 | 4 | _ = stack_trace; |
| 5 | 5 | if (std.mem.eql(u8, message, "invalid error code")) { |
| 6 | 6 | std.process.exit(0); |
test/cases/tail_call_noreturn.zig+2-2| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const builtin = std.builtin; |
| 3 | pub fn foo(message: []const u8, stack_trace: ?*builtin.StackTrace) noreturn { | |
| 3 | pub fn foo(message: []const u8, stack_trace: ?*std.debug.StackTrace) noreturn { | |
| 4 | 4 | @call(.always_tail, bar, .{ message, stack_trace }); |
| 5 | 5 | } |
| 6 | pub fn bar(message: []const u8, stack_trace: ?*builtin.StackTrace) noreturn { | |
| 6 | pub fn bar(message: []const u8, stack_trace: ?*std.debug.StackTrace) noreturn { | |
| 7 | 7 | _ = message; |
| 8 | 8 | _ = stack_trace; |
| 9 | 9 | std.process.exit(0); |
test/stack_traces.zig+9-9| ... | ... | @@ -118,13 +118,13 @@ pub fn addCases(cases: *@import("tests.zig").StackTracesContext) void { |
| 118 | 118 | \\ var stack_trace_buf: [8]usize = undefined; |
| 119 | 119 | \\ dumpIt(&captureIt(&stack_trace_buf)); |
| 120 | 120 | \\} |
| 121 | \\fn captureIt(buf: []usize) std.builtin.StackTrace { | |
| 121 | \\fn captureIt(buf: []usize) std.debug.StackTrace { | |
| 122 | 122 | \\ return captureItInner(buf); |
| 123 | 123 | \\} |
| 124 | \\fn dumpIt(st: *const std.builtin.StackTrace) void { | |
| 124 | \\fn dumpIt(st: *const std.debug.StackTrace) void { | |
| 125 | 125 | \\ std.debug.dumpStackTrace(st); |
| 126 | 126 | \\} |
| 127 | \\fn captureItInner(buf: []usize) std.builtin.StackTrace { | |
| 127 | \\fn captureItInner(buf: []usize) std.debug.StackTrace { | |
| 128 | 128 | \\ return std.debug.captureCurrentStackTrace(.{}, buf); |
| 129 | 129 | \\} |
| 130 | 130 | \\const std = @import("std"); |
| ... | ... | @@ -159,13 +159,13 @@ pub fn addCases(cases: *@import("tests.zig").StackTracesContext) void { |
| 159 | 159 | \\ var stack_trace_buf: [8]usize = undefined; |
| 160 | 160 | \\ dumpIt(&captureIt(&stack_trace_buf)); |
| 161 | 161 | \\} |
| 162 | \\fn captureIt(buf: []usize) std.builtin.StackTrace { | |
| 162 | \\fn captureIt(buf: []usize) std.debug.StackTrace { | |
| 163 | 163 | \\ return captureItInner(buf); |
| 164 | 164 | \\} |
| 165 | \\fn dumpIt(st: *const std.builtin.StackTrace) void { | |
| 165 | \\fn dumpIt(st: *const std.debug.StackTrace) void { | |
| 166 | 166 | \\ std.debug.dumpStackTrace(st); |
| 167 | 167 | \\} |
| 168 | \\fn captureItInner(buf: []usize) std.builtin.StackTrace { | |
| 168 | \\fn captureItInner(buf: []usize) std.debug.StackTrace { | |
| 169 | 169 | \\ return std.debug.captureCurrentStackTrace(.{}, buf); |
| 170 | 170 | \\} |
| 171 | 171 | \\const std = @import("std"); |
| ... | ... | @@ -188,13 +188,13 @@ pub fn addCases(cases: *@import("tests.zig").StackTracesContext) void { |
| 188 | 188 | \\fn threadMain(stack_trace_buf: []usize) void { |
| 189 | 189 | \\ dumpIt(&captureIt(stack_trace_buf)); |
| 190 | 190 | \\} |
| 191 | \\fn captureIt(buf: []usize) std.builtin.StackTrace { | |
| 191 | \\fn captureIt(buf: []usize) std.debug.StackTrace { | |
| 192 | 192 | \\ return captureItInner(buf); |
| 193 | 193 | \\} |
| 194 | \\fn dumpIt(st: *const std.builtin.StackTrace) void { | |
| 194 | \\fn dumpIt(st: *const std.debug.StackTrace) void { | |
| 195 | 195 | \\ std.debug.dumpStackTrace(st); |
| 196 | 196 | \\} |
| 197 | \\fn captureItInner(buf: []usize) std.builtin.StackTrace { | |
| 197 | \\fn captureItInner(buf: []usize) std.debug.StackTrace { | |
| 198 | 198 | \\ return std.debug.captureCurrentStackTrace(.{}, buf); |
| 199 | 199 | \\} |
| 200 | 200 | \\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 { |
| 4 | 4 | _ = atags; |
| 5 | 5 | unreachable; // never gets run so it doesn't matter |
| 6 | 6 | } |
| 7 | pub fn panic(msg: []const u8, error_return_trace: ?*@import("std").builtin.StackTrace, _: ?usize) noreturn { | |
| 7 | pub fn panic(msg: []const u8, error_return_trace: ?*@import("std").debug.StackTrace, _: ?usize) noreturn { | |
| 8 | 8 | _ = msg; |
| 9 | 9 | _ = error_return_trace; |
| 10 | 10 | while (true) {} |
test/standalone/issue_339/test.zig+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | const StackTrace = @import("std").builtin.StackTrace; | |
| 1 | const StackTrace = @import("std").debug.StackTrace; | |
| 2 | 2 | pub fn panic(msg: []const u8, stack_trace: ?*StackTrace, _: ?usize) noreturn { |
| 3 | 3 | _ = msg; |
| 4 | 4 | _ = stack_trace; |
test/tests.zig+1-1| ... | ... | @@ -2200,7 +2200,7 @@ pub fn addCliTests(b: *std.Build) *Step { |
| 2200 | 2200 | \\ return num * num; |
| 2201 | 2201 | \\} |
| 2202 | 2202 | \\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 { | |
| 2204 | 2204 | \\ _ = msg; |
| 2205 | 2205 | \\ _ = error_return_trace; |
| 2206 | 2206 | \\ zig_panic(); |