| ... | ... | @@ -2438,8 +2438,9 @@ fn errMsg( |
| 2438 | 2438 | src: LazySrcLoc, |
| 2439 | 2439 | comptime format: []const u8, |
| 2440 | 2440 | args: anytype, |
| 2441 | | ) error{OutOfMemory}!*Module.ErrorMsg { |
| 2441 | ) error{ NeededSourceLocation, OutOfMemory }!*Module.ErrorMsg { |
| 2442 | 2442 | const mod = sema.mod; |
| 2443 | if (src == .unneeded) return error.NeededSourceLocation; |
| 2443 | 2444 | const src_decl = mod.declPtr(block.src_decl); |
| 2444 | 2445 | return Module.ErrorMsg.create(sema.gpa, src.toSrcLoc(src_decl, mod), format, args); |
| 2445 | 2446 | } |
| ... | ... | @@ -2455,14 +2456,13 @@ pub fn fail( |
| 2455 | 2456 | return sema.failWithOwnedErrorMsg(block, err_msg); |
| 2456 | 2457 | } |
| 2457 | 2458 | |
| 2458 | | fn failWithOwnedErrorMsg(sema: *Sema, block: ?*Block, err_msg: *Module.ErrorMsg) CompileError { |
| 2459 | fn failWithOwnedErrorMsg(sema: *Sema, block: ?*Block, err_msg: *Module.ErrorMsg) error{ AnalysisFail, OutOfMemory } { |
| 2459 | 2460 | @setCold(true); |
| 2460 | 2461 | const gpa = sema.gpa; |
| 2461 | 2462 | const mod = sema.mod; |
| 2462 | 2463 | |
| 2463 | 2464 | ref: { |
| 2464 | 2465 | errdefer err_msg.destroy(gpa); |
| 2465 | | if (err_msg.src_loc.lazy == .unneeded) return error.NeededSourceLocation; |
| 2466 | 2466 | |
| 2467 | 2467 | if (crash_report.is_enabled and mod.comp.debug_compile_errors) { |
| 2468 | 2468 | var wip_errors: std.zig.ErrorBundle.Wip = undefined; |