Skip to content

Commit ba9e388

Browse files
committed
sema: remove source location logic in zirExportValue
`.unneeded` source location should never be passed when the source location is in fact available.
1 parent da06269 commit ba9e388

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Sema.zig

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6034,13 +6034,7 @@ fn zirExportValue(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError
60346034
const operand = try sema.resolveInstConst(block, operand_src, extra.operand, .{
60356035
.needed_comptime_reason = "export target must be comptime-known",
60366036
});
6037-
const options = sema.resolveExportOptions(block, .unneeded, extra.options) catch |err| switch (err) {
6038-
error.NeededSourceLocation => {
6039-
_ = try sema.resolveExportOptions(block, options_src, extra.options);
6040-
unreachable;
6041-
},
6042-
else => |e| return e,
6043-
};
6037+
const options = try sema.resolveExportOptions(block, options_src, extra.options);
60446038
const decl_index = if (operand.val.getFunction(sema.mod)) |function| function.owner_decl else blk: {
60456039
var anon_decl = try block.startAnonDecl(); // TODO: export value without Decl
60466040
defer anon_decl.deinit();

0 commit comments

Comments
 (0)