From ba9e38847a097777370b4721780d5dbefda1b12f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 26 Oct 2023 17:12:17 -0700 Subject: [PATCH] sema: remove source location logic in zirExportValue `.unneeded` source location should never be passed when the source location is in fact available. --- src/Sema.zig | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Sema.zig b/src/Sema.zig index 2970e1f77b..3a347a713b 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -6034,13 +6034,7 @@ fn zirExportValue(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError const operand = try sema.resolveInstConst(block, operand_src, extra.operand, .{ .needed_comptime_reason = "export target must be comptime-known", }); - const options = sema.resolveExportOptions(block, .unneeded, extra.options) catch |err| switch (err) { - error.NeededSourceLocation => { - _ = try sema.resolveExportOptions(block, options_src, extra.options); - unreachable; - }, - else => |e| return e, - }; + const options = try sema.resolveExportOptions(block, options_src, extra.options); const decl_index = if (operand.val.getFunction(sema.mod)) |function| function.owner_decl else blk: { var anon_decl = try block.startAnonDecl(); // TODO: export value without Decl defer anon_decl.deinit();