authorgravatar for carl@astholm.seCarl Åstholm <carl@astholm.se> 2024-01-07 15:54:47+01:00
committergravatar for carl@astholm.seCarl Åstholm <carl@astholm.se> 2024-01-07 16:27:50+01:00
log92458094c8f8294d7bb50d28b09dd2c02b03a25e
treefd046e58c422022b6b293b4b5da6c46698fb4829
parentc8fa767f083e610840cef688b709783c5ad66acc

Fix failing type reifications


2 files changed, 3 insertions(+), 3 deletions(-)

lib/std/meta.zig+1-1
...@@ -1015,7 +1015,7 @@ fn CreateUniqueTuple(comptime N: comptime_int, comptime types: [N]type) type {...@@ -1015,7 +1015,7 @@ fn CreateUniqueTuple(comptime N: comptime_int, comptime types: [N]type) type {
1015 @setEvalBranchQuota(10_000);1015 @setEvalBranchQuota(10_000);
1016 var num_buf: [128]u8 = undefined;1016 var num_buf: [128]u8 = undefined;
1017 tuple_fields[i] = .{1017 tuple_fields[i] = .{
1018 .name = std.fmt.bufPrint(&num_buf, "{d}", .{i}) catch unreachable,1018 .name = std.fmt.bufPrintZ(&num_buf, "{d}", .{i}) catch unreachable,
1019 .type = T,1019 .type = T,
1020 .default_value = null,1020 .default_value = null,
1021 .is_comptime = false,1021 .is_comptime = false,
test/behavior/type.zig+2-2
...@@ -549,7 +549,7 @@ test "Type.Fn" {...@@ -549,7 +549,7 @@ test "Type.Fn" {
549549
550test "reified struct field name from optional payload" {550test "reified struct field name from optional payload" {
551 comptime {551 comptime {
552 const m_name: ?[1]u8 = "a".*;552 const m_name: ?[1:0]u8 = "a".*;
553 if (m_name) |*name| {553 if (m_name) |*name| {
554 const T = @Type(.{ .Struct = .{554 const T = @Type(.{ .Struct = .{
555 .layout = .Auto,555 .layout = .Auto,
...@@ -711,7 +711,7 @@ test "struct field names sliced at comptime from larger string" {...@@ -711,7 +711,7 @@ test "struct field names sliced at comptime from larger string" {
711 while (it.next()) |name| {711 while (it.next()) |name| {
712 fields = fields ++ &[_]Type.StructField{.{712 fields = fields ++ &[_]Type.StructField{.{
713 .alignment = 0,713 .alignment = 0,
714 .name = name,714 .name = name ++ "",
715 .type = usize,715 .type = usize,
716 .default_value = null,716 .default_value = null,
717 .is_comptime = false,717 .is_comptime = false,