Skip to content

Commit d0bc5ef

Browse files
committed
Sema: remove dead logic
This is redundant because `storePtr2` will coerce to the return type which (in `Sema.coerceInMemoryAllowedErrorSets`) will add errors to the current function's IES if necessary.
1 parent b1dcf2b commit d0bc5ef

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/Sema.zig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5328,8 +5328,6 @@ fn zirStoreNode(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!v
53285328
const tracy = trace(@src());
53295329
defer tracy.end();
53305330

5331-
const pt = sema.pt;
5332-
const zcu = pt.zcu;
53335331
const zir_tags = sema.code.instructions.items(.tag);
53345332
const zir_datas = sema.code.instructions.items(.data);
53355333
const inst_data = zir_datas[@intFromEnum(inst)].pl_node;
@@ -5343,16 +5341,6 @@ fn zirStoreNode(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!v
53435341
else
53445342
false;
53455343

5346-
// Check for the possibility of this pattern:
5347-
// %a = ret_ptr
5348-
// %b = store(%a, %c)
5349-
// Where %c is an error union or error set. In such case we need to add
5350-
// to the current function's inferred error set, if any.
5351-
if (is_ret and sema.fn_ret_ty_ies != null) switch (sema.typeOf(operand).zigTypeTag(zcu)) {
5352-
.error_union, .error_set => try sema.addToInferredErrorSet(operand),
5353-
else => {},
5354-
};
5355-
53565344
const ptr_src = block.src(.{ .node_offset_store_ptr = inst_data.src_node });
53575345
const operand_src = block.src(.{ .node_offset_store_operand = inst_data.src_node });
53585346
const air_tag: Air.Inst.Tag = if (is_ret)

0 commit comments

Comments
 (0)