diff --git a/lib/std/meta.zig b/lib/std/meta.zig index 41b3ca291f..94d5f962bc 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -1015,7 +1015,7 @@ fn CreateUniqueTuple(comptime N: comptime_int, comptime types: [N]type) type { @setEvalBranchQuota(10_000); var num_buf: [128]u8 = undefined; tuple_fields[i] = .{ - .name = std.fmt.bufPrint(&num_buf, "{d}", .{i}) catch unreachable, + .name = std.fmt.bufPrintZ(&num_buf, "{d}", .{i}) catch unreachable, .type = T, .default_value = null, .is_comptime = false, diff --git a/test/behavior/type.zig b/test/behavior/type.zig index 7cb9212c30..1ce31fecfd 100644 --- a/test/behavior/type.zig +++ b/test/behavior/type.zig @@ -549,7 +549,7 @@ test "Type.Fn" { test "reified struct field name from optional payload" { comptime { - const m_name: ?[1]u8 = "a".*; + const m_name: ?[1:0]u8 = "a".*; if (m_name) |*name| { const T = @Type(.{ .Struct = .{ .layout = .Auto, @@ -711,7 +711,7 @@ test "struct field names sliced at comptime from larger string" { while (it.next()) |name| { fields = fields ++ &[_]Type.StructField{.{ .alignment = 0, - .name = name, + .name = name ++ "", .type = usize, .default_value = null, .is_comptime = false,