| author | |
| committer | |
| log | ece62a0223cfad5e49a5c75a944a21e735a01a05 |
| tree | 225c943cd10757137362c4073244d8e4d294ff19 |
| parent | 3f34f5e43349214c862882a83bd951701a6c735f |
7 files changed, 55 insertions(+), 35 deletions(-)
src/Compilation.zig+15-15| ... | ... | @@ -2851,6 +2851,7 @@ fn cleanupAfterUpdate(comp: *Compilation, tmp_dir_rand_int: u64) void { |
| 2851 | 2851 | |
| 2852 | 2852 | pub const UpdateError = error{ |
| 2853 | 2853 | OutOfMemory, |
| 2854 | Canceled, | |
| 2854 | 2855 | Unexpected, |
| 2855 | 2856 | CurrentWorkingDirectoryUnlinked, |
| 2856 | 2857 | }; |
| ... | ... | @@ -2930,6 +2931,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE |
| 2930 | 2931 | }, |
| 2931 | 2932 | }, |
| 2932 | 2933 | error.OutOfMemory => return error.OutOfMemory, |
| 2934 | error.Canceled => return error.Canceled, | |
| 2933 | 2935 | error.InvalidFormat => return comp.setMiscFailure( |
| 2934 | 2936 | .check_whole_cache, |
| 2935 | 2937 | "failed to check cache: invalid manifest file format", |
| ... | ... | @@ -5010,7 +5012,7 @@ fn performAllTheWork( |
| 5010 | 5012 | } |
| 5011 | 5013 | } |
| 5012 | 5014 | |
| 5013 | const JobError = Allocator.Error; | |
| 5015 | const JobError = Allocator.Error || Io.Cancelable; | |
| 5014 | 5016 | |
| 5015 | 5017 | pub fn queueJob(comp: *Compilation, job: Job) !void { |
| 5016 | 5018 | try comp.work_queues[Job.stage(job)].pushBack(comp.gpa, job); |
| ... | ... | @@ -5117,6 +5119,7 @@ fn processOneJob(tid: usize, comp: *Compilation, job: Job) JobError!void { |
| 5117 | 5119 | |
| 5118 | 5120 | pt.ensureFuncBodyUpToDate(func) catch |err| switch (err) { |
| 5119 | 5121 | error.OutOfMemory => |e| return e, |
| 5122 | error.Canceled => |e| return e, | |
| 5120 | 5123 | error.AnalysisFail => return, |
| 5121 | 5124 | }; |
| 5122 | 5125 | }, |
| ... | ... | @@ -5137,6 +5140,7 @@ fn processOneJob(tid: usize, comp: *Compilation, job: Job) JobError!void { |
| 5137 | 5140 | }; |
| 5138 | 5141 | maybe_err catch |err| switch (err) { |
| 5139 | 5142 | error.OutOfMemory => |e| return e, |
| 5143 | error.Canceled => |e| return e, | |
| 5140 | 5144 | error.AnalysisFail => return, |
| 5141 | 5145 | }; |
| 5142 | 5146 | |
| ... | ... | @@ -5166,7 +5170,7 @@ fn processOneJob(tid: usize, comp: *Compilation, job: Job) JobError!void { |
| 5166 | 5170 | const pt: Zcu.PerThread = .activate(comp.zcu.?, @enumFromInt(tid)); |
| 5167 | 5171 | defer pt.deactivate(); |
| 5168 | 5172 | Type.fromInterned(ty).resolveFully(pt) catch |err| switch (err) { |
| 5169 | error.OutOfMemory => return error.OutOfMemory, | |
| 5173 | error.OutOfMemory, error.Canceled => |e| return e, | |
| 5170 | 5174 | error.AnalysisFail => return, |
| 5171 | 5175 | }; |
| 5172 | 5176 | }, |
| ... | ... | @@ -5177,7 +5181,7 @@ fn processOneJob(tid: usize, comp: *Compilation, job: Job) JobError!void { |
| 5177 | 5181 | const pt: Zcu.PerThread = .activate(comp.zcu.?, @enumFromInt(tid)); |
| 5178 | 5182 | defer pt.deactivate(); |
| 5179 | 5183 | pt.semaMod(mod) catch |err| switch (err) { |
| 5180 | error.OutOfMemory => return error.OutOfMemory, | |
| 5184 | error.OutOfMemory, error.Canceled => |e| return e, | |
| 5181 | 5185 | error.AnalysisFail => return, |
| 5182 | 5186 | }; |
| 5183 | 5187 | }, |
| ... | ... | @@ -5190,8 +5194,8 @@ fn processOneJob(tid: usize, comp: *Compilation, job: Job) JobError!void { |
| 5190 | 5194 | // TODO Surface more error details. |
| 5191 | 5195 | comp.lockAndSetMiscFailure( |
| 5192 | 5196 | .windows_import_lib, |
| 5193 | "unable to generate DLL import .lib file for {s}: {s}", | |
| 5194 | .{ link_lib, @errorName(err) }, | |
| 5197 | "unable to generate DLL import .lib file for {s}: {t}", | |
| 5198 | .{ link_lib, err }, | |
| 5195 | 5199 | ); |
| 5196 | 5200 | }; |
| 5197 | 5201 | }, |
| ... | ... | @@ -6066,14 +6070,10 @@ fn buildLibZigC(comp: *Compilation, prog_node: std.Progress.Node) void { |
| 6066 | 6070 | }; |
| 6067 | 6071 | } |
| 6068 | 6072 | |
| 6069 | fn reportRetryableCObjectError( | |
| 6070 | comp: *Compilation, | |
| 6071 | c_object: *CObject, | |
| 6072 | err: anyerror, | |
| 6073 | ) error{OutOfMemory}!void { | |
| 6073 | fn reportRetryableCObjectError(comp: *Compilation, c_object: *CObject, err: anyerror) error{OutOfMemory}!void { | |
| 6074 | 6074 | c_object.status = .failure_retryable; |
| 6075 | 6075 | |
| 6076 | switch (comp.failCObj(c_object, "{s}", .{@errorName(err)})) { | |
| 6076 | switch (comp.failCObj(c_object, "{t}", .{err})) { | |
| 6077 | 6077 | error.AnalysisFail => return, |
| 6078 | 6078 | else => |e| return e, |
| 6079 | 6079 | } |
| ... | ... | @@ -7317,7 +7317,7 @@ fn failCObj( |
| 7317 | 7317 | c_object: *CObject, |
| 7318 | 7318 | comptime format: []const u8, |
| 7319 | 7319 | args: anytype, |
| 7320 | ) SemaError { | |
| 7320 | ) error{ OutOfMemory, AnalysisFail } { | |
| 7321 | 7321 | @branchHint(.cold); |
| 7322 | 7322 | const diag_bundle = blk: { |
| 7323 | 7323 | const diag_bundle = try comp.gpa.create(CObject.Diag.Bundle); |
| ... | ... | @@ -7341,7 +7341,7 @@ fn failCObjWithOwnedDiagBundle( |
| 7341 | 7341 | comp: *Compilation, |
| 7342 | 7342 | c_object: *CObject, |
| 7343 | 7343 | diag_bundle: *CObject.Diag.Bundle, |
| 7344 | ) SemaError { | |
| 7344 | ) error{ OutOfMemory, AnalysisFail } { | |
| 7345 | 7345 | @branchHint(.cold); |
| 7346 | 7346 | assert(diag_bundle.diags.len > 0); |
| 7347 | 7347 | { |
| ... | ... | @@ -7357,7 +7357,7 @@ fn failCObjWithOwnedDiagBundle( |
| 7357 | 7357 | return error.AnalysisFail; |
| 7358 | 7358 | } |
| 7359 | 7359 | |
| 7360 | fn failWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, comptime format: []const u8, args: anytype) SemaError { | |
| 7360 | fn failWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, comptime format: []const u8, args: anytype) error{ OutOfMemory, AnalysisFail } { | |
| 7361 | 7361 | @branchHint(.cold); |
| 7362 | 7362 | var bundle: ErrorBundle.Wip = undefined; |
| 7363 | 7363 | try bundle.init(comp.gpa); |
| ... | ... | @@ -7384,7 +7384,7 @@ fn failWin32ResourceWithOwnedBundle( |
| 7384 | 7384 | comp: *Compilation, |
| 7385 | 7385 | win32_resource: *Win32Resource, |
| 7386 | 7386 | err_bundle: ErrorBundle, |
| 7387 | ) SemaError { | |
| 7387 | ) error{ OutOfMemory, AnalysisFail } { | |
| 7388 | 7388 | @branchHint(.cold); |
| 7389 | 7389 | { |
| 7390 | 7390 | comp.mutex.lock(); |
src/Sema.zig+8-6| ... | ... | @@ -6696,7 +6696,7 @@ pub fn analyzeSaveErrRetIndex(sema: *Sema, block: *Block) SemaError!Air.Inst.Ref |
| 6696 | 6696 | const field_index = sema.structFieldIndex(block, stack_trace_ty, field_name, LazySrcLoc.unneeded) catch |err| switch (err) { |
| 6697 | 6697 | error.AnalysisFail => @panic("std.builtin.StackTrace is corrupt"), |
| 6698 | 6698 | error.ComptimeReturn, error.ComptimeBreak => unreachable, |
| 6699 | error.OutOfMemory => |e| return e, | |
| 6699 | error.OutOfMemory, error.Canceled => |e| return e, | |
| 6700 | 6700 | }; |
| 6701 | 6701 | |
| 6702 | 6702 | return try block.addInst(.{ |
| ... | ... | @@ -13924,6 +13924,7 @@ fn zirEmbedFile(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A |
| 13924 | 13924 | return sema.fail(block, operand_src, "unable to resolve '{s}': working directory has been unlinked", .{name}); |
| 13925 | 13925 | }, |
| 13926 | 13926 | error.OutOfMemory => |e| return e, |
| 13927 | error.Canceled => |e| return e, | |
| 13927 | 13928 | }; |
| 13928 | 13929 | try sema.declareDependency(.{ .embed_file = ef_idx }); |
| 13929 | 13930 | |
| ... | ... | @@ -34345,7 +34346,7 @@ pub fn resolveStructLayout(sema: *Sema, ty: Type) SemaError!void { |
| 34345 | 34346 | |
| 34346 | 34347 | if (struct_type.layout == .@"packed") { |
| 34347 | 34348 | sema.backingIntType(struct_type) catch |err| switch (err) { |
| 34348 | error.OutOfMemory, error.AnalysisFail => |e| return e, | |
| 34349 | error.AnalysisFail, error.OutOfMemory, error.Canceled => |e| return e, | |
| 34349 | 34350 | error.ComptimeBreak, error.ComptimeReturn => unreachable, |
| 34350 | 34351 | }; |
| 34351 | 34352 | return; |
| ... | ... | @@ -34893,7 +34894,7 @@ pub fn resolveStructFieldTypes( |
| 34893 | 34894 | defer tracked_unit.end(zcu); |
| 34894 | 34895 | |
| 34895 | 34896 | sema.structFields(struct_type) catch |err| switch (err) { |
| 34896 | error.AnalysisFail, error.OutOfMemory => |e| return e, | |
| 34897 | error.AnalysisFail, error.OutOfMemory, error.Canceled => |e| return e, | |
| 34897 | 34898 | error.ComptimeBreak, error.ComptimeReturn => unreachable, |
| 34898 | 34899 | }; |
| 34899 | 34900 | } |
| ... | ... | @@ -34926,7 +34927,7 @@ pub fn resolveStructFieldInits(sema: *Sema, ty: Type) SemaError!void { |
| 34926 | 34927 | defer tracked_unit.end(zcu); |
| 34927 | 34928 | |
| 34928 | 34929 | sema.structFieldInits(struct_type) catch |err| switch (err) { |
| 34929 | error.AnalysisFail, error.OutOfMemory => |e| return e, | |
| 34930 | error.AnalysisFail, error.OutOfMemory, error.Canceled => |e| return e, | |
| 34930 | 34931 | error.ComptimeBreak, error.ComptimeReturn => unreachable, |
| 34931 | 34932 | }; |
| 34932 | 34933 | struct_type.setHaveFieldInits(ip); |
| ... | ... | @@ -34960,7 +34961,7 @@ pub fn resolveUnionFieldTypes(sema: *Sema, ty: Type, union_type: InternPool.Load |
| 34960 | 34961 | union_type.setStatus(ip, .field_types_wip); |
| 34961 | 34962 | errdefer union_type.setStatus(ip, .none); |
| 34962 | 34963 | sema.unionFields(ty.toIntern(), union_type) catch |err| switch (err) { |
| 34963 | error.AnalysisFail, error.OutOfMemory => |e| return e, | |
| 34964 | error.AnalysisFail, error.OutOfMemory, error.Canceled => |e| return e, | |
| 34964 | 34965 | error.ComptimeBreak, error.ComptimeReturn => unreachable, |
| 34965 | 34966 | }; |
| 34966 | 34967 | union_type.setStatus(ip, .have_field_types); |
| ... | ... | @@ -37027,6 +37028,7 @@ fn notePathToComptimeAllocPtr( |
| 37027 | 37028 | |
| 37028 | 37029 | const derivation = comptime_ptr.pointerDerivationAdvanced(arena, pt, false, sema) catch |err| switch (err) { |
| 37029 | 37030 | error.OutOfMemory => |e| return e, |
| 37031 | error.Canceled => @panic("TODO"), // pls don't be cancelable mlugg | |
| 37030 | 37032 | error.AnalysisFail => unreachable, |
| 37031 | 37033 | }; |
| 37032 | 37034 | |
| ... | ... | @@ -37367,7 +37369,7 @@ pub fn resolveDeclaredEnum( |
| 37367 | 37369 | ) catch |err| switch (err) { |
| 37368 | 37370 | error.ComptimeBreak => unreachable, |
| 37369 | 37371 | error.ComptimeReturn => unreachable, |
| 37370 | error.OutOfMemory => |e| return e, | |
| 37372 | error.OutOfMemory, error.Canceled => |e| return e, | |
| 37371 | 37373 | error.AnalysisFail => { |
| 37372 | 37374 | if (!zcu.failed_analysis.contains(sema.owner)) { |
| 37373 | 37375 | try zcu.transitive_failed_analysis.put(gpa, sema.owner, {}); |
src/Type.zig+2-1| ... | ... | @@ -3837,7 +3837,7 @@ fn resolveStructInner( |
| 3837 | 3837 | } |
| 3838 | 3838 | return error.AnalysisFail; |
| 3839 | 3839 | }, |
| 3840 | error.OutOfMemory => |e| return e, | |
| 3840 | error.OutOfMemory, error.Canceled => |e| return e, | |
| 3841 | 3841 | }; |
| 3842 | 3842 | } |
| 3843 | 3843 | |
| ... | ... | @@ -3896,6 +3896,7 @@ fn resolveUnionInner( |
| 3896 | 3896 | return error.AnalysisFail; |
| 3897 | 3897 | }, |
| 3898 | 3898 | error.OutOfMemory => |e| return e, |
| 3899 | error.Canceled => |e| return e, | |
| 3899 | 3900 | }; |
| 3900 | 3901 | } |
| 3901 | 3902 |
src/Value.zig+7-3| ... | ... | @@ -1,12 +1,15 @@ |
| 1 | const std = @import("std"); | |
| 2 | const builtin = @import("builtin"); | |
| 3 | 1 | const build_options = @import("build_options"); |
| 4 | const Type = @import("Type.zig"); | |
| 2 | const builtin = @import("builtin"); | |
| 3 | ||
| 4 | const std = @import("std"); | |
| 5 | const Io = std.Io; | |
| 5 | 6 | const assert = std.debug.assert; |
| 6 | 7 | const BigIntConst = std.math.big.int.Const; |
| 7 | 8 | const BigIntMutable = std.math.big.int.Mutable; |
| 8 | 9 | const Target = std.Target; |
| 9 | 10 | const Allocator = std.mem.Allocator; |
| 11 | ||
| 12 | const Type = @import("Type.zig"); | |
| 10 | 13 | const Zcu = @import("Zcu.zig"); |
| 11 | 14 | const Sema = @import("Sema.zig"); |
| 12 | 15 | const InternPool = @import("InternPool.zig"); |
| ... | ... | @@ -2410,6 +2413,7 @@ pub const PointerDeriveStep = union(enum) { |
| 2410 | 2413 | pub fn pointerDerivation(ptr_val: Value, arena: Allocator, pt: Zcu.PerThread) Allocator.Error!PointerDeriveStep { |
| 2411 | 2414 | return ptr_val.pointerDerivationAdvanced(arena, pt, false, null) catch |err| switch (err) { |
| 2412 | 2415 | error.OutOfMemory => |e| return e, |
| 2416 | error.Canceled => @panic("TODO"), // pls remove from error set mlugg | |
| 2413 | 2417 | error.AnalysisFail => unreachable, |
| 2414 | 2418 | }; |
| 2415 | 2419 | } |
src/Zcu.zig+3-1| ... | ... | @@ -2755,9 +2755,11 @@ pub const LazySrcLoc = struct { |
| 2755 | 2755 | } |
| 2756 | 2756 | }; |
| 2757 | 2757 | |
| 2758 | pub const SemaError = error{ OutOfMemory, AnalysisFail }; | |
| 2758 | pub const SemaError = error{ OutOfMemory, Canceled, AnalysisFail }; | |
| 2759 | 2759 | pub const CompileError = error{ |
| 2760 | 2760 | OutOfMemory, |
| 2761 | /// The compilation update is no longer desired. | |
| 2762 | Canceled, | |
| 2761 | 2763 | /// When this is returned, the compile error for the failure has already been recorded. |
| 2762 | 2764 | AnalysisFail, |
| 2763 | 2765 | /// In a comptime scope, a return instruction was encountered. This error is only seen when |
src/Zcu/PerThread.zig+18-9| ... | ... | @@ -1,26 +1,31 @@ |
| 1 | 1 | //! This type provides a wrapper around a `*Zcu` for uses which require a thread `Id`. |
| 2 | 2 | //! Any operation which mutates `InternPool` state lives here rather than on `Zcu`. |
| 3 | 3 | |
| 4 | const Air = @import("../Air.zig"); | |
| 4 | const std = @import("std"); | |
| 5 | 5 | const Allocator = std.mem.Allocator; |
| 6 | 6 | const assert = std.debug.assert; |
| 7 | 7 | const Ast = std.zig.Ast; |
| 8 | 8 | const AstGen = std.zig.AstGen; |
| 9 | 9 | const BigIntConst = std.math.big.int.Const; |
| 10 | 10 | const BigIntMutable = std.math.big.int.Mutable; |
| 11 | const Cache = std.Build.Cache; | |
| 12 | const log = std.log.scoped(.zcu); | |
| 13 | const mem = std.mem; | |
| 14 | const Zir = std.zig.Zir; | |
| 15 | const Zoir = std.zig.Zoir; | |
| 16 | const ZonGen = std.zig.ZonGen; | |
| 17 | const Io = std.Io; | |
| 18 | ||
| 19 | const Air = @import("../Air.zig"); | |
| 11 | 20 | const Builtin = @import("../Builtin.zig"); |
| 12 | 21 | const build_options = @import("build_options"); |
| 13 | 22 | const builtin = @import("builtin"); |
| 14 | const Cache = std.Build.Cache; | |
| 15 | 23 | const dev = @import("../dev.zig"); |
| 16 | 24 | const InternPool = @import("../InternPool.zig"); |
| 17 | 25 | const AnalUnit = InternPool.AnalUnit; |
| 18 | 26 | const introspect = @import("../introspect.zig"); |
| 19 | const log = std.log.scoped(.zcu); | |
| 20 | 27 | const Module = @import("../Package.zig").Module; |
| 21 | 28 | const Sema = @import("../Sema.zig"); |
| 22 | const std = @import("std"); | |
| 23 | const mem = std.mem; | |
| 24 | 29 | const target_util = @import("../target.zig"); |
| 25 | 30 | const trace = @import("../tracy.zig").trace; |
| 26 | 31 | const Type = @import("../Type.zig"); |
| ... | ... | @@ -29,9 +34,6 @@ const Zcu = @import("../Zcu.zig"); |
| 29 | 34 | const Compilation = @import("../Compilation.zig"); |
| 30 | 35 | const codegen = @import("../codegen.zig"); |
| 31 | 36 | const crash_report = @import("../crash_report.zig"); |
| 32 | const Zir = std.zig.Zir; | |
| 33 | const Zoir = std.zig.Zoir; | |
| 34 | const ZonGen = std.zig.ZonGen; | |
| 35 | 37 | |
| 36 | 38 | zcu: *Zcu, |
| 37 | 39 | |
| ... | ... | @@ -678,6 +680,7 @@ pub fn ensureMemoizedStateUpToDate(pt: Zcu.PerThread, stage: InternPool.Memoized |
| 678 | 680 | // TODO: same as for `ensureComptimeUnitUpToDate` etc |
| 679 | 681 | return error.OutOfMemory; |
| 680 | 682 | }, |
| 683 | error.Canceled => |e| return e, | |
| 681 | 684 | error.ComptimeReturn => unreachable, |
| 682 | 685 | error.ComptimeBreak => unreachable, |
| 683 | 686 | }; |
| ... | ... | @@ -842,6 +845,7 @@ pub fn ensureComptimeUnitUpToDate(pt: Zcu.PerThread, cu_id: InternPool.ComptimeU |
| 842 | 845 | // for reporting OOM errors without allocating. |
| 843 | 846 | return error.OutOfMemory; |
| 844 | 847 | }, |
| 848 | error.Canceled => |e| return e, | |
| 845 | 849 | error.ComptimeReturn => unreachable, |
| 846 | 850 | error.ComptimeBreak => unreachable, |
| 847 | 851 | }; |
| ... | ... | @@ -1030,6 +1034,7 @@ pub fn ensureNavValUpToDate(pt: Zcu.PerThread, nav_id: InternPool.Nav.Index) Zcu |
| 1030 | 1034 | // for reporting OOM errors without allocating. |
| 1031 | 1035 | return error.OutOfMemory; |
| 1032 | 1036 | }, |
| 1037 | error.Canceled => |e| return e, | |
| 1033 | 1038 | error.ComptimeReturn => unreachable, |
| 1034 | 1039 | error.ComptimeBreak => unreachable, |
| 1035 | 1040 | }; |
| ... | ... | @@ -1443,6 +1448,7 @@ pub fn ensureNavTypeUpToDate(pt: Zcu.PerThread, nav_id: InternPool.Nav.Index) Zc |
| 1443 | 1448 | // for reporting OOM errors without allocating. |
| 1444 | 1449 | return error.OutOfMemory; |
| 1445 | 1450 | }, |
| 1451 | error.Canceled => |e| return e, | |
| 1446 | 1452 | error.ComptimeReturn => unreachable, |
| 1447 | 1453 | error.ComptimeBreak => unreachable, |
| 1448 | 1454 | }; |
| ... | ... | @@ -1668,6 +1674,7 @@ pub fn ensureFuncBodyUpToDate(pt: Zcu.PerThread, func_index: InternPool.Index) Z |
| 1668 | 1674 | // for reporting OOM errors without allocating. |
| 1669 | 1675 | return error.OutOfMemory; |
| 1670 | 1676 | }, |
| 1677 | error.Canceled => |e| return e, | |
| 1671 | 1678 | }; |
| 1672 | 1679 | |
| 1673 | 1680 | if (was_outdated) { |
| ... | ... | @@ -2360,6 +2367,7 @@ pub fn embedFile( |
| 2360 | 2367 | import_string: []const u8, |
| 2361 | 2368 | ) error{ |
| 2362 | 2369 | OutOfMemory, |
| 2370 | Canceled, | |
| 2363 | 2371 | ImportOutsideModulePath, |
| 2364 | 2372 | CurrentWorkingDirectoryUnlinked, |
| 2365 | 2373 | }!Zcu.EmbedFile.Index { |
| ... | ... | @@ -4123,7 +4131,7 @@ fn recreateEnumType( |
| 4123 | 4131 | pt: Zcu.PerThread, |
| 4124 | 4132 | old_ty: InternPool.Index, |
| 4125 | 4133 | key: InternPool.Key.NamespaceType.Declared, |
| 4126 | ) Allocator.Error!InternPool.Index { | |
| 4134 | ) (Allocator.Error || Io.Cancelable)!InternPool.Index { | |
| 4127 | 4135 | const zcu = pt.zcu; |
| 4128 | 4136 | const gpa = zcu.gpa; |
| 4129 | 4137 | const ip = &zcu.intern_pool; |
| ... | ... | @@ -4234,6 +4242,7 @@ fn recreateEnumType( |
| 4234 | 4242 | body_end, |
| 4235 | 4243 | ) catch |err| switch (err) { |
| 4236 | 4244 | error.OutOfMemory => |e| return e, |
| 4245 | error.Canceled => |e| return e, | |
| 4237 | 4246 | error.AnalysisFail => {}, // call sites are responsible for checking `[transitive_]failed_analysis` to detect this |
| 4238 | 4247 | }; |
| 4239 | 4248 |
src/print_value.zig+2| ... | ... | @@ -27,6 +27,7 @@ pub fn formatSema(ctx: FormatContext, writer: *Writer) Writer.Error!void { |
| 27 | 27 | error.OutOfMemory => @panic("OOM"), // We're not allowed to return this from a format function |
| 28 | 28 | error.ComptimeBreak, error.ComptimeReturn => unreachable, |
| 29 | 29 | error.AnalysisFail => unreachable, // TODO: re-evaluate when we use `sema` more fully |
| 30 | error.Canceled => @panic("TODO"), // pls stop returning this error mlugg | |
| 30 | 31 | else => |e| return e, |
| 31 | 32 | }; |
| 32 | 33 | } |
| ... | ... | @@ -36,6 +37,7 @@ pub fn format(ctx: FormatContext, writer: *Writer) Writer.Error!void { |
| 36 | 37 | return print(ctx.val, writer, ctx.depth, ctx.pt, null) catch |err| switch (err) { |
| 37 | 38 | error.OutOfMemory => @panic("OOM"), // We're not allowed to return this from a format function |
| 38 | 39 | error.ComptimeBreak, error.ComptimeReturn, error.AnalysisFail => unreachable, |
| 40 | error.Canceled => @panic("TODO"), // pls stop returning this error mlugg | |
| 39 | 41 | else => |e| return e, |
| 40 | 42 | }; |
| 41 | 43 | } |