stage2: make error{} the same size as anyerror

Having `error{}` be a zero bit type causes issues when it interracts
with empty inferred error sets which are the same size as `anyerror`.
This commit is contained in:
Veikka Tuominen
2022-06-10 14:11:59 +03:00
parent 488e1e5f51
commit 0333ff4476
11 changed files with 123 additions and 476 deletions

View File

@@ -705,15 +705,6 @@ pub fn generateSymbol(
.ErrorUnion => {
const error_ty = typed_value.ty.errorUnionSet();
const payload_ty = typed_value.ty.errorUnionPayload();
if (error_ty.errorSetCardinality() == .zero) {
const payload_val = typed_value.val.castTag(.eu_payload).?.data;
return generateSymbol(bin_file, src_loc, .{
.ty = payload_ty,
.val = payload_val,
}, code, debug_output, reloc_info);
}
const is_payload = typed_value.val.errorUnionIsPayload();
if (!payload_ty.hasRuntimeBitsIgnoreComptime()) {