authorgravatar for me@tadeo.caTadeo Kondrak <me@tadeo.ca> 2020-08-21 14:37:50-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-22 03:20:12-04:00
loga049c31f2184895c731636b6f71c5743200d64fc
tree22da0c2f0538fae98526925db835091c2f54ee7d
parente919744c7ad2b224bef00ffc35ccacbe31a0aae7

Remove TypeInfo.Error.value


3 files changed, 1 insertions(+), 7 deletions(-)

lib/std/builtin.zig-2
......@@ -289,8 +289,6 @@ pub const TypeInfo = union(enum) {
289289 /// therefore must be kept in sync with the compiler implementation.
290290 pub const Error = struct {
291291 name: []const u8,
292 /// This field is ignored when using @Type().
293 value: comptime_int,
294292 };
295293
296294 /// This data structure is used by the Zig language code generation and
src/ir.cpp+1-4
......@@ -25494,9 +25494,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
2549425494 error_val->special = ConstValSpecialStatic;
2549525495 error_val->type = type_info_error_type;
2549625496
25497 ZigValue **inner_fields = alloc_const_vals_ptrs(ira->codegen, 2);
25498 inner_fields[1]->special = ConstValSpecialStatic;
25499 inner_fields[1]->type = ira->codegen->builtin_types.entry_num_lit_int;
25497 ZigValue **inner_fields = alloc_const_vals_ptrs(ira->codegen, 1);
2550025498
2550125499 ZigValue *name = nullptr;
2550225500 if (error->cached_error_name_val != nullptr)
......@@ -25504,7 +25502,6 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
2550425502 if (name == nullptr)
2550525503 name = create_const_str_lit(ira->codegen, &error->name)->data.x_ptr.data.ref.pointee;
2550625504 init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(&error->name), true);
25507 bigint_init_unsigned(&inner_fields[1]->data.x_bigint, error->value);
2550825505
2550925506 error_val->data.x_struct.fields = inner_fields;
2551025507 error_val->parent.id = ConstParentIdArray;
test/stage1/behavior/type_info.zig-1
......@@ -153,7 +153,6 @@ fn testErrorSet() void {
153153 expect(error_set_info == .ErrorSet);
154154 expect(error_set_info.ErrorSet.?.len == 3);
155155 expect(mem.eql(u8, error_set_info.ErrorSet.?[0].name, "First"));
156 expect(error_set_info.ErrorSet.?[2].value == @errorToInt(TestErrorSet.Third));
157156
158157 const error_union_info = @typeInfo(TestErrorSet!usize);
159158 expect(error_union_info == .ErrorUnion);