| ... | @@ -3403,7 +3403,7 @@ fn validateUnionInit( | ... | @@ -3403,7 +3403,7 @@ fn validateUnionInit( |
| 3403 | | 3403 | |
| 3404 | for (instrs[1..]) |inst| { | 3404 | for (instrs[1..]) |inst| { |
| 3405 | const inst_data = sema.code.instructions.items(.data)[inst].pl_node; | 3405 | const inst_data = sema.code.instructions.items(.data)[inst].pl_node; |
| 3406 | const inst_src: LazySrcLoc = .{ .node_offset_back2tok = inst_data.src_node }; | 3406 | const inst_src: LazySrcLoc = .{ .node_offset_initializer = inst_data.src_node }; |
| 3407 | try sema.errNote(block, inst_src, msg, "additional initializer here", .{}); | 3407 | try sema.errNote(block, inst_src, msg, "additional initializer here", .{}); |
| 3408 | } | 3408 | } |
| 3409 | try sema.addDeclaredHereNote(msg, union_ty); | 3409 | try sema.addDeclaredHereNote(msg, union_ty); |
| ... | @@ -3421,7 +3421,7 @@ fn validateUnionInit( | ... | @@ -3421,7 +3421,7 @@ fn validateUnionInit( |
| 3421 | | 3421 | |
| 3422 | const field_ptr = instrs[0]; | 3422 | const field_ptr = instrs[0]; |
| 3423 | const field_ptr_data = sema.code.instructions.items(.data)[field_ptr].pl_node; | 3423 | const field_ptr_data = sema.code.instructions.items(.data)[field_ptr].pl_node; |
| 3424 | const field_src: LazySrcLoc = .{ .node_offset_back2tok = field_ptr_data.src_node }; | 3424 | const field_src: LazySrcLoc = .{ .node_offset_initializer = field_ptr_data.src_node }; |
| 3425 | const field_ptr_extra = sema.code.extraData(Zir.Inst.Field, field_ptr_data.payload_index).data; | 3425 | const field_ptr_extra = sema.code.extraData(Zir.Inst.Field, field_ptr_data.payload_index).data; |
| 3426 | const field_name = sema.code.nullTerminatedString(field_ptr_extra.field_name_start); | 3426 | const field_name = sema.code.nullTerminatedString(field_ptr_extra.field_name_start); |
| 3427 | const field_index = try sema.unionFieldIndex(block, union_ty, field_name, field_src); | 3427 | const field_index = try sema.unionFieldIndex(block, union_ty, field_name, field_src); |
| ... | @@ -3523,7 +3523,7 @@ fn validateStructInit( | ... | @@ -3523,7 +3523,7 @@ fn validateStructInit( |
| 3523 | | 3523 | |
| 3524 | for (instrs) |field_ptr| { | 3524 | for (instrs) |field_ptr| { |
| 3525 | const field_ptr_data = sema.code.instructions.items(.data)[field_ptr].pl_node; | 3525 | const field_ptr_data = sema.code.instructions.items(.data)[field_ptr].pl_node; |
| 3526 | const field_src: LazySrcLoc = .{ .node_offset_back2tok = field_ptr_data.src_node }; | 3526 | const field_src: LazySrcLoc = .{ .node_offset_initializer = field_ptr_data.src_node }; |
| 3527 | const field_ptr_extra = sema.code.extraData(Zir.Inst.Field, field_ptr_data.payload_index).data; | 3527 | const field_ptr_extra = sema.code.extraData(Zir.Inst.Field, field_ptr_data.payload_index).data; |
| 3528 | struct_ptr_zir_ref = field_ptr_extra.lhs; | 3528 | struct_ptr_zir_ref = field_ptr_extra.lhs; |
| 3529 | const field_name = sema.code.nullTerminatedString(field_ptr_extra.field_name_start); | 3529 | const field_name = sema.code.nullTerminatedString(field_ptr_extra.field_name_start); |
| ... | @@ -3531,7 +3531,7 @@ fn validateStructInit( | ... | @@ -3531,7 +3531,7 @@ fn validateStructInit( |
| 3531 | if (found_fields[field_index] != 0) { | 3531 | if (found_fields[field_index] != 0) { |
| 3532 | const other_field_ptr = found_fields[field_index]; | 3532 | const other_field_ptr = found_fields[field_index]; |
| 3533 | const other_field_ptr_data = sema.code.instructions.items(.data)[other_field_ptr].pl_node; | 3533 | const other_field_ptr_data = sema.code.instructions.items(.data)[other_field_ptr].pl_node; |
| 3534 | const other_field_src: LazySrcLoc = .{ .node_offset_back2tok = other_field_ptr_data.src_node }; | 3534 | const other_field_src: LazySrcLoc = .{ .node_offset_initializer = other_field_ptr_data.src_node }; |
| 3535 | const msg = msg: { | 3535 | const msg = msg: { |
| 3536 | const msg = try sema.errMsg(block, field_src, "duplicate field", .{}); | 3536 | const msg = try sema.errMsg(block, field_src, "duplicate field", .{}); |
| 3537 | errdefer msg.destroy(gpa); | 3537 | errdefer msg.destroy(gpa); |
| ... | @@ -3606,7 +3606,7 @@ fn validateStructInit( | ... | @@ -3606,7 +3606,7 @@ fn validateStructInit( |
| 3606 | field: for (found_fields) |field_ptr, i| { | 3606 | field: for (found_fields) |field_ptr, i| { |
| 3607 | if (field_ptr != 0) { | 3607 | if (field_ptr != 0) { |
| 3608 | const field_ptr_data = sema.code.instructions.items(.data)[field_ptr].pl_node; | 3608 | const field_ptr_data = sema.code.instructions.items(.data)[field_ptr].pl_node; |
| 3609 | const field_src: LazySrcLoc = .{ .node_offset_back2tok = field_ptr_data.src_node }; | 3609 | const field_src: LazySrcLoc = .{ .node_offset_initializer = field_ptr_data.src_node }; |
| 3610 | | 3610 | |
| 3611 | // Determine whether the value stored to this pointer is comptime-known. | 3611 | // Determine whether the value stored to this pointer is comptime-known. |
| 3612 | const field_ty = struct_ty.structFieldType(i); | 3612 | const field_ty = struct_ty.structFieldType(i); |
| ... | @@ -13999,14 +13999,14 @@ fn zirStructInit( | ... | @@ -13999,14 +13999,14 @@ fn zirStructInit( |
| 13999 | extra_index = item.end; | 13999 | extra_index = item.end; |
| 14000 | | 14000 | |
| 14001 | const field_type_data = zir_datas[item.data.field_type].pl_node; | 14001 | const field_type_data = zir_datas[item.data.field_type].pl_node; |
| 14002 | const field_src: LazySrcLoc = .{ .node_offset_back2tok = field_type_data.src_node }; | 14002 | const field_src: LazySrcLoc = .{ .node_offset_initializer = field_type_data.src_node }; |
| 14003 | const field_type_extra = sema.code.extraData(Zir.Inst.FieldType, field_type_data.payload_index).data; | 14003 | const field_type_extra = sema.code.extraData(Zir.Inst.FieldType, field_type_data.payload_index).data; |
| 14004 | const field_name = sema.code.nullTerminatedString(field_type_extra.name_start); | 14004 | const field_name = sema.code.nullTerminatedString(field_type_extra.name_start); |
| 14005 | const field_index = try sema.structFieldIndex(block, resolved_ty, field_name, field_src); | 14005 | const field_index = try sema.structFieldIndex(block, resolved_ty, field_name, field_src); |
| 14006 | if (field_inits[field_index] != .none) { | 14006 | if (field_inits[field_index] != .none) { |
| 14007 | const other_field_type = found_fields[field_index]; | 14007 | const other_field_type = found_fields[field_index]; |
| 14008 | const other_field_type_data = zir_datas[other_field_type].pl_node; | 14008 | const other_field_type_data = zir_datas[other_field_type].pl_node; |
| 14009 | const other_field_src: LazySrcLoc = .{ .node_offset_back2tok = other_field_type_data.src_node }; | 14009 | const other_field_src: LazySrcLoc = .{ .node_offset_initializer = other_field_type_data.src_node }; |
| 14010 | const msg = msg: { | 14010 | const msg = msg: { |
| 14011 | const msg = try sema.errMsg(block, field_src, "duplicate field", .{}); | 14011 | const msg = try sema.errMsg(block, field_src, "duplicate field", .{}); |
| 14012 | errdefer msg.destroy(gpa); | 14012 | errdefer msg.destroy(gpa); |
| ... | @@ -14028,7 +14028,7 @@ fn zirStructInit( | ... | @@ -14028,7 +14028,7 @@ fn zirStructInit( |
| 14028 | const item = sema.code.extraData(Zir.Inst.StructInit.Item, extra.end); | 14028 | const item = sema.code.extraData(Zir.Inst.StructInit.Item, extra.end); |
| 14029 | | 14029 | |
| 14030 | const field_type_data = zir_datas[item.data.field_type].pl_node; | 14030 | const field_type_data = zir_datas[item.data.field_type].pl_node; |
| 14031 | const field_src: LazySrcLoc = .{ .node_offset_back2tok = field_type_data.src_node }; | 14031 | const field_src: LazySrcLoc = .{ .node_offset_initializer = field_type_data.src_node }; |
| 14032 | const field_type_extra = sema.code.extraData(Zir.Inst.FieldType, field_type_data.payload_index).data; | 14032 | const field_type_extra = sema.code.extraData(Zir.Inst.FieldType, field_type_data.payload_index).data; |
| 14033 | const field_name = sema.code.nullTerminatedString(field_type_extra.name_start); | 14033 | const field_name = sema.code.nullTerminatedString(field_type_extra.name_start); |
| 14034 | const field_index = try sema.unionFieldIndex(block, resolved_ty, field_name, field_src); | 14034 | const field_index = try sema.unionFieldIndex(block, resolved_ty, field_name, field_src); |