| ... | ... | @@ -21775,11 +21775,9 @@ fn zirErrorCast(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData |
| 21775 | 21775 | if (dest_tag == .ErrorUnion) { |
| 21776 | 21776 | const err_code = try sema.analyzeErrUnionCode(block, operand_src, operand); |
| 21777 | 21777 | const err_int = try block.addBitCast(err_int_ty, err_code); |
| 21778 | | const zero_u16 = Air.internedToRef(try mod.intern(.{ |
| 21779 | | .int = .{ .ty = .u16_type, .storage = .{ .u64 = 0 } }, |
| 21780 | | })); |
| 21778 | const zero_err = try mod.intRef(try mod.errorIntType(), 0); |
| 21781 | 21779 | |
| 21782 | | const is_zero = try block.addBinOp(.cmp_eq, err_int, zero_u16); |
| 21780 | const is_zero = try block.addBinOp(.cmp_eq, err_int, zero_err); |
| 21783 | 21781 | if (disjoint) { |
| 21784 | 21782 | // Error must be zero. |
| 21785 | 21783 | try sema.addSafetyCheck(block, src, is_zero, .invalid_error_code); |