| ... | @@ -2317,8 +2317,8 @@ fn zirErrorSetDecl( | ... | @@ -2317,8 +2317,8 @@ fn zirErrorSetDecl( |
| 2317 | const extra_index_end = extra_index + (extra.data.fields_len * 2); | 2317 | const extra_index_end = extra_index + (extra.data.fields_len * 2); |
| 2318 | while (extra_index < extra_index_end) : (extra_index += 2) { // +2 to skip over doc_string | 2318 | while (extra_index < extra_index_end) : (extra_index += 2) { // +2 to skip over doc_string |
| 2319 | const str_index = sema.code.extra[extra_index]; | 2319 | const str_index = sema.code.extra[extra_index]; |
| 2320 | const name = try new_decl_arena_allocator.dupe(u8, sema.code.nullTerminatedString(str_index)); | 2320 | const kv = try sema.mod.getErrorValue(sema.code.nullTerminatedString(str_index)); |
| 2321 | const result = names.getOrPutAssumeCapacity(name); | 2321 | const result = names.getOrPutAssumeCapacity(kv.key); |
| 2322 | assert(!result.found_existing); // verified in AstGen | 2322 | assert(!result.found_existing); // verified in AstGen |
| 2323 | } | 2323 | } |
| 2324 | | 2324 | |
| ... | @@ -13113,11 +13113,10 @@ fn zirReify(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.I | ... | @@ -13113,11 +13113,10 @@ fn zirReify(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.I |
| 13113 | // TODO use reflection instead of magic numbers here | 13113 | // TODO use reflection instead of magic numbers here |
| 13114 | // error_set: type, | 13114 | // error_set: type, |
| 13115 | const name_val = struct_val[0]; | 13115 | const name_val = struct_val[0]; |
| | 13116 | const name_str = try name_val.toAllocatedBytes(Type.initTag(.const_slice_u8), sema.arena, target); |
| 13116 | | 13117 | |
| 13117 | names.putAssumeCapacityNoClobber( | 13118 | const kv = try sema.mod.getErrorValue(name_str); |
| 13118 | try name_val.toAllocatedBytes(Type.initTag(.const_slice_u8), sema.arena, target), | 13119 | names.putAssumeCapacityNoClobber(kv.key, {}); |
| 13119 | {}, | | |
| 13120 | ); | | |
| 13121 | } | 13120 | } |
| 13122 | | 13121 | |
| 13123 | // names must be sorted | 13122 | // names must be sorted |