all: update to std.builtin.Type.{Pointer,Array,StructField} field renames
This commit is contained in:
@@ -7,7 +7,7 @@ export fn entry() void {
|
||||
.address_space = .generic,
|
||||
.child = u8,
|
||||
.is_allowzero = false,
|
||||
.sentinel = &@as(u8, 0),
|
||||
.sentinel_ptr = &@as(u8, 0),
|
||||
} });
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ comptime {
|
||||
}
|
||||
|
||||
comptime {
|
||||
_ = @Type(.{ .array = .{ .child = S, .len = 0, .sentinel = &sentinel } });
|
||||
_ = @Type(.{ .array = .{ .child = S, .len = 0, .sentinel_ptr = &sentinel } });
|
||||
}
|
||||
comptime {
|
||||
_ = @Type(.{ .pointer = .{
|
||||
@@ -23,7 +23,7 @@ comptime {
|
||||
.address_space = .generic,
|
||||
.child = S,
|
||||
.is_allowzero = false,
|
||||
.sentinel = &sentinel,
|
||||
.sentinel_ptr = &sentinel,
|
||||
} });
|
||||
}
|
||||
comptime {
|
||||
@@ -35,7 +35,7 @@ comptime {
|
||||
.address_space = .generic,
|
||||
.child = S,
|
||||
.is_allowzero = false,
|
||||
.sentinel = &sentinel,
|
||||
.sentinel_ptr = &sentinel,
|
||||
} });
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
export fn entry() void {
|
||||
_ = @Type(.{ .@"struct" = .{ .layout = .@"packed", .fields = &.{
|
||||
.{ .name = "one", .type = u4, .default_value = null, .is_comptime = false, .alignment = 2 },
|
||||
.{ .name = "one", .type = u4, .default_value_ptr = null, .is_comptime = false, .alignment = 2 },
|
||||
}, .decls = &.{}, .is_tuple = false } });
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :2:9: error: alignment in a packed struct field must be set to 0
|
||||
|
||||
@@ -4,7 +4,7 @@ comptime {
|
||||
.fields = &.{.{
|
||||
.name = "foo",
|
||||
.type = u32,
|
||||
.default_value = null,
|
||||
.default_value_ptr = null,
|
||||
.is_comptime = false,
|
||||
.alignment = 4,
|
||||
}},
|
||||
@@ -18,7 +18,7 @@ comptime {
|
||||
.fields = &.{.{
|
||||
.name = "3",
|
||||
.type = u32,
|
||||
.default_value = null,
|
||||
.default_value_ptr = null,
|
||||
.is_comptime = false,
|
||||
.alignment = 4,
|
||||
}},
|
||||
@@ -32,7 +32,7 @@ comptime {
|
||||
.fields = &.{.{
|
||||
.name = "0",
|
||||
.type = u32,
|
||||
.default_value = null,
|
||||
.default_value_ptr = null,
|
||||
.is_comptime = true,
|
||||
.alignment = 4,
|
||||
}},
|
||||
@@ -46,7 +46,7 @@ comptime {
|
||||
.fields = &.{.{
|
||||
.name = "0",
|
||||
.type = u32,
|
||||
.default_value = null,
|
||||
.default_value_ptr = null,
|
||||
.is_comptime = true,
|
||||
.alignment = 4,
|
||||
}},
|
||||
@@ -60,7 +60,7 @@ comptime {
|
||||
.fields = &.{.{
|
||||
.name = "0",
|
||||
.type = u32,
|
||||
.default_value = null,
|
||||
.default_value_ptr = null,
|
||||
.is_comptime = true,
|
||||
.alignment = 4,
|
||||
}},
|
||||
@@ -70,8 +70,6 @@ comptime {
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :2:5: error: tuple cannot have non-numeric field 'foo'
|
||||
// :16:5: error: tuple field name '3' does not match field index 0
|
||||
|
||||
@@ -17,7 +17,7 @@ comptime {
|
||||
.fields = &.{.{
|
||||
.name = "0",
|
||||
.type = u32,
|
||||
.default_value = null,
|
||||
.default_value_ptr = null,
|
||||
.is_comptime = true,
|
||||
.alignment = 5,
|
||||
}},
|
||||
@@ -36,7 +36,7 @@ comptime {
|
||||
.address_space = .generic,
|
||||
.child = u8,
|
||||
.is_allowzero = false,
|
||||
.sentinel = null,
|
||||
.sentinel_ptr = null,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
comptime {
|
||||
_ = @Type(.{ .array = .{ .len = 0, .child = u8, .sentinel = undefined } });
|
||||
_ = @Type(.{ .array = .{ .len = 0, .child = u8, .sentinel_ptr = undefined } });
|
||||
}
|
||||
comptime {
|
||||
_ = @Type(.{
|
||||
|
||||
Reference in New Issue
Block a user