Skip to content

Commit 9245809

Browse files
committed
Fix failing type reifications
1 parent c8fa767 commit 9245809

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/std/meta.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ fn CreateUniqueTuple(comptime N: comptime_int, comptime types: [N]type) type {
10151015
@setEvalBranchQuota(10_000);
10161016
var num_buf: [128]u8 = undefined;
10171017
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,
10191019
.type = T,
10201020
.default_value = null,
10211021
.is_comptime = false,

test/behavior/type.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ test "Type.Fn" {
549549

550550
test "reified struct field name from optional payload" {
551551
comptime {
552-
const m_name: ?[1]u8 = "a".*;
552+
const m_name: ?[1:0]u8 = "a".*;
553553
if (m_name) |*name| {
554554
const T = @Type(.{ .Struct = .{
555555
.layout = .Auto,
@@ -711,7 +711,7 @@ test "struct field names sliced at comptime from larger string" {
711711
while (it.next()) |name| {
712712
fields = fields ++ &[_]Type.StructField{.{
713713
.alignment = 0,
714-
.name = name,
714+
.name = name ++ "",
715715
.type = usize,
716716
.default_value = null,
717717
.is_comptime = false,

0 commit comments

Comments
 (0)