authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-05-18 19:05:46-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-10 20:47:53-07:00
logf21ca3da190c8c64fd99c700f0840af59792b6b2
tree7a2853ce05fb11ad9dc81d9252f32d601459f156
parent17882162b3be5542b4e289e5ddc6535a4bb4c6b1

compiler: move `anyframe->T` to InternPool

Also I moved `anyframe` from being represented by `SimpleType` to being represented by the `none` tag of `anyframe_type` because most code wants to handle these two types together.

4 files changed, 101 insertions(+), 105 deletions(-)

src/InternPool.zig+28-6
......@@ -132,6 +132,9 @@ pub const Key = union(enum) {
132132 array_type: ArrayType,
133133 vector_type: VectorType,
134134 opt_type: Index,
135 /// `anyframe->T`. The payload is the child type, which may be `none` to indicate
136 /// `anyframe`.
137 anyframe_type: Index,
135138 error_union_type: struct {
136139 error_set_type: Index,
137140 payload_type: Index,
......@@ -503,6 +506,7 @@ pub const Key = union(enum) {
503506 .array_type,
504507 .vector_type,
505508 .opt_type,
509 .anyframe_type,
506510 .error_union_type,
507511 .simple_type,
508512 .simple_value,
......@@ -597,7 +601,11 @@ pub const Key = union(enum) {
597601 },
598602 .opt_type => |a_info| {
599603 const b_info = b.opt_type;
600 return std.meta.eql(a_info, b_info);
604 return a_info == b_info;
605 },
606 .anyframe_type => |a_info| {
607 const b_info = b.anyframe_type;
608 return a_info == b_info;
601609 },
602610 .error_union_type => |a_info| {
603611 const b_info = b.error_union_type;
......@@ -752,6 +760,7 @@ pub const Key = union(enum) {
752760 .array_type,
753761 .vector_type,
754762 .opt_type,
763 .anyframe_type,
755764 .error_union_type,
756765 .simple_type,
757766 .struct_type,
......@@ -1037,7 +1046,7 @@ pub const static_keys = [_]Key{
10371046 .{ .simple_type = .comptime_int },
10381047 .{ .simple_type = .comptime_float },
10391048 .{ .simple_type = .noreturn },
1040 .{ .simple_type = .@"anyframe" },
1049 .{ .anyframe_type = .none },
10411050 .{ .simple_type = .null },
10421051 .{ .simple_type = .undefined },
10431052 .{ .simple_type = .enum_literal },
......@@ -1203,6 +1212,10 @@ pub const Tag = enum(u8) {
12031212 /// An optional type.
12041213 /// data is the child type.
12051214 type_optional,
1215 /// The type `anyframe->T`.
1216 /// data is the child type.
1217 /// If the child type is `none`, the type is `anyframe`.
1218 type_anyframe,
12061219 /// An error union type.
12071220 /// data is payload to ErrorUnion.
12081221 type_error_union,
......@@ -1421,7 +1434,6 @@ pub const SimpleType = enum(u32) {
14211434 comptime_int,
14221435 comptime_float,
14231436 noreturn,
1424 @"anyframe",
14251437 null,
14261438 undefined,
14271439 enum_literal,
......@@ -1781,6 +1793,7 @@ pub fn indexToKey(ip: InternPool, index: Index) Key {
17811793 },
17821794
17831795 .type_optional => .{ .opt_type = @intToEnum(Index, data) },
1796 .type_anyframe => .{ .anyframe_type = @intToEnum(Index, data) },
17841797
17851798 .type_error_union => @panic("TODO"),
17861799
......@@ -2144,10 +2157,18 @@ pub fn get(ip: *InternPool, gpa: Allocator, key: Key) Allocator.Error!Index {
21442157 }),
21452158 });
21462159 },
2147 .opt_type => |opt_type| {
2160 .opt_type => |payload_type| {
2161 assert(payload_type != .none);
21482162 ip.items.appendAssumeCapacity(.{
21492163 .tag = .type_optional,
2150 .data = @enumToInt(opt_type),
2164 .data = @enumToInt(payload_type),
2165 });
2166 },
2167 .anyframe_type => |payload_type| {
2168 // payload_type might be none, indicating the type is `anyframe`.
2169 ip.items.appendAssumeCapacity(.{
2170 .tag = .type_anyframe,
2171 .data = @enumToInt(payload_type),
21512172 });
21522173 },
21532174 .error_union_type => |error_union_type| {
......@@ -3063,7 +3084,7 @@ pub fn childType(ip: InternPool, i: Index) Index {
30633084 .ptr_type => |ptr_type| ptr_type.elem_type,
30643085 .vector_type => |vector_type| vector_type.child,
30653086 .array_type => |array_type| array_type.child,
3066 .opt_type => |child| child,
3087 .opt_type, .anyframe_type => |child| child,
30673088 else => unreachable,
30683089 };
30693090}
......@@ -3231,6 +3252,7 @@ fn dumpFallible(ip: InternPool, arena: Allocator) anyerror!void {
32313252 .type_pointer => @sizeOf(Pointer),
32323253 .type_slice => 0,
32333254 .type_optional => 0,
3255 .type_anyframe => 0,
32343256 .type_error_union => @sizeOf(ErrorUnion),
32353257 .type_enum_explicit, .type_enum_nonexhaustive => @sizeOf(EnumExplicit),
32363258 .type_enum_auto => @sizeOf(EnumAuto),
src/Module.zig+6
......@@ -6869,6 +6869,12 @@ pub fn funcType(mod: *Module, info: InternPool.Key.FuncType) Allocator.Error!Typ
68696869 return (try intern(mod, .{ .func_type = info })).toType();
68706870}
68716871
6872/// Use this for `anyframe->T` only.
6873/// For `anyframe`, use the `InternPool.Index.anyframe` tag directly.
6874pub fn anyframeType(mod: *Module, payload_ty: Type) Allocator.Error!Type {
6875 return (try intern(mod, .{ .anyframe_type = payload_ty.toIntern() })).toType();
6876}
6877
68726878/// Supports optionals in addition to pointers.
68736879pub fn ptrIntValue(mod: *Module, ty: Type, x: u64) Allocator.Error!Value {
68746880 if (ty.isPtrLikeOptional(mod)) {
src/Sema.zig+11-13
......@@ -8042,9 +8042,10 @@ fn zirAnyframeType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErro
80428042 if (true) {
80438043 return sema.failWithUseOfAsync(block, inst_data.src());
80448044 }
8045 const mod = sema.mod;
80458046 const operand_src: LazySrcLoc = .{ .node_offset_anyframe_type = inst_data.src_node };
80468047 const return_type = try sema.resolveType(block, operand_src, inst_data.operand);
8047 const anyframe_type = try Type.Tag.anyframe_T.create(sema.arena, return_type);
8048 const anyframe_type = try mod.anyframeType(return_type);
80488049
80498050 return sema.addType(anyframe_type);
80508051}
......@@ -31626,10 +31627,6 @@ pub fn resolveTypeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {
3162631627 },
3162731628
3162831629 .error_union => return sema.resolveTypeRequiresComptime(ty.errorUnionPayload()),
31629 .anyframe_T => {
31630 const child_ty = ty.castTag(.anyframe_T).?.data;
31631 return sema.resolveTypeRequiresComptime(child_ty);
31632 },
3163331630 },
3163431631 else => switch (mod.intern_pool.indexToKey(ty.ip_index)) {
3163531632 .int_type => false,
......@@ -31641,6 +31638,10 @@ pub fn resolveTypeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {
3164131638 return sema.resolveTypeRequiresComptime(child_ty);
3164231639 }
3164331640 },
31641 .anyframe_type => |child| {
31642 if (child == .none) return false;
31643 return sema.resolveTypeRequiresComptime(child.toType());
31644 },
3164431645 .array_type => |array_type| return sema.resolveTypeRequiresComptime(array_type.child.toType()),
3164531646 .vector_type => |vector_type| return sema.resolveTypeRequiresComptime(vector_type.child.toType()),
3164631647 .opt_type => |child| return sema.resolveTypeRequiresComptime(child.toType()),
......@@ -31669,7 +31670,6 @@ pub fn resolveTypeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {
3166931670 .bool,
3167031671 .void,
3167131672 .anyerror,
31672 .@"anyframe",
3167331673 .noreturn,
3167431674 .generic_poison,
3167531675 .var_args_param,
......@@ -33054,7 +33054,6 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value {
3305433054 .error_set_merged,
3305533055 .error_union,
3305633056 .error_set_inferred,
33057 .anyframe_T,
3305833057 .pointer,
3305933058 => return null,
3306033059
......@@ -33083,6 +33082,7 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value {
3308333082 .ptr_type,
3308433083 .error_union_type,
3308533084 .func_type,
33085 .anyframe_type,
3308633086 => null,
3308733087
3308833088 .array_type => |array_type| {
......@@ -33130,7 +33130,6 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value {
3313033130 .anyerror,
3313133131 .comptime_int,
3313233132 .comptime_float,
33133 .@"anyframe",
3313433133 .enum_literal,
3313533134 .atomic_order,
3313633135 .atomic_rmw_op,
......@@ -33688,10 +33687,6 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {
3368833687 },
3368933688
3369033689 .error_union => return sema.typeRequiresComptime(ty.errorUnionPayload()),
33691 .anyframe_T => {
33692 const child_ty = ty.castTag(.anyframe_T).?.data;
33693 return sema.typeRequiresComptime(child_ty);
33694 },
3369533690 },
3369633691 else => switch (mod.intern_pool.indexToKey(ty.ip_index)) {
3369733692 .int_type => return false,
......@@ -33703,6 +33698,10 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {
3370333698 return sema.typeRequiresComptime(child_ty);
3370433699 }
3370533700 },
33701 .anyframe_type => |child| {
33702 if (child == .none) return false;
33703 return sema.typeRequiresComptime(child.toType());
33704 },
3370633705 .array_type => |array_type| return sema.typeRequiresComptime(array_type.child.toType()),
3370733706 .vector_type => |vector_type| return sema.typeRequiresComptime(vector_type.child.toType()),
3370833707 .opt_type => |child| return sema.typeRequiresComptime(child.toType()),
......@@ -33733,7 +33732,6 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {
3373333732 .bool,
3373433733 .void,
3373533734 .anyerror,
33736 .@"anyframe",
3373733735 .noreturn,
3373833736 .generic_poison,
3373933737 .atomic_order,
src/type.zig+56-86
......@@ -50,21 +50,20 @@ pub const Type = struct {
5050 .optional => return .Optional,
5151
5252 .error_union => return .ErrorUnion,
53
54 .anyframe_T => return .AnyFrame,
5553 },
56 else => switch (mod.intern_pool.indexToKey(ty.ip_index)) {
57 .int_type => return .Int,
58 .ptr_type => return .Pointer,
59 .array_type => return .Array,
60 .vector_type => return .Vector,
61 .opt_type => return .Optional,
62 .error_union_type => return .ErrorUnion,
63 .struct_type, .anon_struct_type => return .Struct,
64 .union_type => return .Union,
65 .opaque_type => return .Opaque,
66 .enum_type => return .Enum,
67 .func_type => return .Fn,
54 else => return switch (mod.intern_pool.indexToKey(ty.ip_index)) {
55 .int_type => .Int,
56 .ptr_type => .Pointer,
57 .array_type => .Array,
58 .vector_type => .Vector,
59 .opt_type => .Optional,
60 .error_union_type => .ErrorUnion,
61 .struct_type, .anon_struct_type => .Struct,
62 .union_type => .Union,
63 .opaque_type => .Opaque,
64 .enum_type => .Enum,
65 .func_type => .Fn,
66 .anyframe_type => .AnyFrame,
6867 .simple_type => |s| switch (s) {
6968 .f16,
7069 .f32,
......@@ -72,7 +71,7 @@ pub const Type = struct {
7271 .f80,
7372 .f128,
7473 .c_longdouble,
75 => return .Float,
74 => .Float,
7675
7776 .usize,
7877 .isize,
......@@ -85,20 +84,19 @@ pub const Type = struct {
8584 .c_ulong,
8685 .c_longlong,
8786 .c_ulonglong,
88 => return .Int,
89
90 .anyopaque => return .Opaque,
91 .bool => return .Bool,
92 .void => return .Void,
93 .type => return .Type,
94 .anyerror => return .ErrorSet,
95 .comptime_int => return .ComptimeInt,
96 .comptime_float => return .ComptimeFloat,
97 .noreturn => return .NoReturn,
98 .@"anyframe" => return .AnyFrame,
99 .null => return .Null,
100 .undefined => return .Undefined,
101 .enum_literal => return .EnumLiteral,
87 => .Int,
88
89 .anyopaque => .Opaque,
90 .bool => .Bool,
91 .void => .Void,
92 .type => .Type,
93 .anyerror => .ErrorSet,
94 .comptime_int => .ComptimeInt,
95 .comptime_float => .ComptimeFloat,
96 .noreturn => .NoReturn,
97 .null => .Null,
98 .undefined => .Undefined,
99 .enum_literal => .EnumLiteral,
102100
103101 .atomic_order,
104102 .atomic_rmw_op,
......@@ -107,14 +105,14 @@ pub const Type = struct {
107105 .float_mode,
108106 .reduce_op,
109107 .call_modifier,
110 => return .Enum,
108 => .Enum,
111109
112110 .prefetch_options,
113111 .export_options,
114112 .extern_options,
115 => return .Struct,
113 => .Struct,
116114
117 .type_info => return .Union,
115 .type_info => .Union,
118116
119117 .generic_poison => return error.GenericPoison,
120118 .var_args_param => unreachable,
......@@ -408,11 +406,6 @@ pub const Type = struct {
408406
409407 return true;
410408 },
411
412 .anyframe_T => {
413 if (b.zigTypeTag(mod) != .AnyFrame) return false;
414 return a.elemType2(mod).eql(b.elemType2(mod), mod);
415 },
416409 }
417410 }
418411
......@@ -488,11 +481,6 @@ pub const Type = struct {
488481 const payload_ty = ty.errorUnionPayload();
489482 hashWithHasher(payload_ty, hasher, mod);
490483 },
491
492 .anyframe_T => {
493 std.hash.autoHash(hasher, std.builtin.TypeId.AnyFrame);
494 hashWithHasher(ty.childType(mod), hasher, mod);
495 },
496484 }
497485 }
498486
......@@ -542,9 +530,7 @@ pub const Type = struct {
542530 .inferred_alloc_mut,
543531 => unreachable,
544532
545 .optional,
546 .anyframe_T,
547 => {
533 .optional => {
548534 const payload = self.cast(Payload.ElemType).?;
549535 const new_payload = try allocator.create(Payload.ElemType);
550536 new_payload.* = .{
......@@ -668,12 +654,6 @@ pub const Type = struct {
668654 while (true) {
669655 const t = ty.tag();
670656 switch (t) {
671 .anyframe_T => {
672 const return_type = ty.castTag(.anyframe_T).?.data;
673 try writer.print("anyframe->", .{});
674 ty = return_type;
675 continue;
676 },
677657 .optional => {
678658 const child_type = ty.castTag(.optional).?.data;
679659 try writer.writeByte('?');
......@@ -838,11 +818,6 @@ pub const Type = struct {
838818 try writer.writeByte('?');
839819 try print(child_type, writer, mod);
840820 },
841 .anyframe_T => {
842 const return_type = ty.castTag(.anyframe_T).?.data;
843 try writer.print("anyframe->", .{});
844 try print(return_type, writer, mod);
845 },
846821 .error_set => {
847822 const names = ty.castTag(.error_set).?.data.names.keys();
848823 try writer.writeAll("error{");
......@@ -1034,6 +1009,11 @@ pub const Type = struct {
10341009 try print(fn_info.return_type.toType(), writer, mod);
10351010 }
10361011 },
1012 .anyframe_type => |child| {
1013 if (child == .none) return writer.writeAll("anyframe");
1014 try writer.writeAll("anyframe->");
1015 return print(child.toType(), writer, mod);
1016 },
10371017
10381018 // values, not types
10391019 .undef => unreachable,
......@@ -1098,9 +1078,7 @@ pub const Type = struct {
10981078
10991079 // Pointers to zero-bit types still have a runtime address; however, pointers
11001080 // to comptime-only types do not, with the exception of function pointers.
1101 .anyframe_T,
1102 .pointer,
1103 => {
1081 .pointer => {
11041082 if (ignore_comptime_only) {
11051083 return true;
11061084 } else if (ty.childType(mod).zigTypeTag(mod) == .Fn) {
......@@ -1141,6 +1119,7 @@ pub const Type = struct {
11411119 if (strat == .sema) return !(try strat.sema.typeRequiresComptime(ty));
11421120 return !comptimeOnly(ty, mod);
11431121 },
1122 .anyframe_type => true,
11441123 .array_type => |array_type| {
11451124 if (array_type.sentinel != .none) {
11461125 return array_type.child.toType().hasRuntimeBitsAdvanced(mod, ignore_comptime_only, strat);
......@@ -1195,7 +1174,6 @@ pub const Type = struct {
11951174 .c_longdouble,
11961175 .bool,
11971176 .anyerror,
1198 .@"anyframe",
11991177 .anyopaque,
12001178 .atomic_order,
12011179 .atomic_rmw_op,
......@@ -1319,7 +1297,6 @@ pub const Type = struct {
13191297 .error_set_inferred,
13201298 .error_set_merged,
13211299 .error_union,
1322 .anyframe_T,
13231300 => false,
13241301
13251302 .inferred_alloc_mut => unreachable,
......@@ -1336,6 +1313,7 @@ pub const Type = struct {
13361313 .error_union_type,
13371314 .anon_struct_type,
13381315 .opaque_type,
1316 .anyframe_type,
13391317 // These are function bodies, not function pointers.
13401318 .func_type,
13411319 => false,
......@@ -1366,7 +1344,6 @@ pub const Type = struct {
13661344 => true,
13671345
13681346 .anyerror,
1369 .@"anyframe",
13701347 .anyopaque,
13711348 .atomic_order,
13721349 .atomic_rmw_op,
......@@ -1594,9 +1571,7 @@ pub const Type = struct {
15941571 switch (ty.ip_index) {
15951572 .empty_struct_type => return AbiAlignmentAdvanced{ .scalar = 0 },
15961573 .none => switch (ty.tag()) {
1597 .pointer,
1598 .anyframe_T,
1599 => return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },
1574 .pointer => return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },
16001575
16011576 // TODO revisit this when we have the concept of the error tag type
16021577 .error_set_inferred,
......@@ -1617,7 +1592,7 @@ pub const Type = struct {
16171592 if (int_type.bits == 0) return AbiAlignmentAdvanced{ .scalar = 0 };
16181593 return AbiAlignmentAdvanced{ .scalar = intAbiAlignment(int_type.bits, target) };
16191594 },
1620 .ptr_type => {
1595 .ptr_type, .anyframe_type => {
16211596 return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) };
16221597 },
16231598 .array_type => |array_type| {
......@@ -1657,7 +1632,6 @@ pub const Type = struct {
16571632 .isize,
16581633 .export_options,
16591634 .extern_options,
1660 .@"anyframe",
16611635 => return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },
16621636
16631637 .c_char => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.char) },
......@@ -1976,8 +1950,6 @@ pub const Type = struct {
19761950 .inferred_alloc_const => unreachable,
19771951 .inferred_alloc_mut => unreachable,
19781952
1979 .anyframe_T => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },
1980
19811953 .pointer => switch (ty.castTag(.pointer).?.data.size) {
19821954 .Slice => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) * 2 },
19831955 else => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },
......@@ -2039,6 +2011,8 @@ pub const Type = struct {
20392011 .Slice => return .{ .scalar = @divExact(target.ptrBitWidth(), 8) * 2 },
20402012 else => return .{ .scalar = @divExact(target.ptrBitWidth(), 8) },
20412013 },
2014 .anyframe_type => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },
2015
20422016 .array_type => |array_type| {
20432017 const len = array_type.len + @boolToInt(array_type.sentinel != .none);
20442018 switch (try array_type.child.toType().abiSizeAdvanced(mod, strat)) {
......@@ -2102,7 +2076,6 @@ pub const Type = struct {
21022076
21032077 .usize,
21042078 .isize,
2105 .@"anyframe",
21062079 => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },
21072080
21082081 .c_char => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.char) },
......@@ -2298,8 +2271,6 @@ pub const Type = struct {
22982271 .inferred_alloc_const => unreachable,
22992272 .inferred_alloc_mut => unreachable,
23002273
2301 .anyframe_T => return target.ptrBitWidth(),
2302
23032274 .pointer => switch (ty.castTag(.pointer).?.data.size) {
23042275 .Slice => return target.ptrBitWidth() * 2,
23052276 else => return target.ptrBitWidth(),
......@@ -2323,6 +2294,8 @@ pub const Type = struct {
23232294 .Slice => return target.ptrBitWidth() * 2,
23242295 else => return target.ptrBitWidth() * 2,
23252296 },
2297 .anyframe_type => return target.ptrBitWidth(),
2298
23262299 .array_type => |array_type| {
23272300 const len = array_type.len + @boolToInt(array_type.sentinel != .none);
23282301 if (len == 0) return 0;
......@@ -2349,7 +2322,6 @@ pub const Type = struct {
23492322
23502323 .usize,
23512324 .isize,
2352 .@"anyframe",
23532325 => return target.ptrBitWidth(),
23542326
23552327 .c_char => return target.c_type_bit_size(.char),
......@@ -2777,8 +2749,6 @@ pub const Type = struct {
27772749 },
27782750 .optional => ty.castTag(.optional).?.data.childType(mod),
27792751
2780 .anyframe_T => ty.castTag(.anyframe_T).?.data,
2781
27822752 else => unreachable,
27832753 },
27842754 else => switch (mod.intern_pool.indexToKey(ty.ip_index)) {
......@@ -2786,6 +2756,10 @@ pub const Type = struct {
27862756 .One => ptr_type.elem_type.toType().shallowElemType(mod),
27872757 .Many, .C, .Slice => ptr_type.elem_type.toType(),
27882758 },
2759 .anyframe_type => |child| {
2760 assert(child != .none);
2761 return child.toType();
2762 },
27892763 .vector_type => |vector_type| vector_type.child.toType(),
27902764 .array_type => |array_type| array_type.child.toType(),
27912765 .opt_type => |child| mod.intern_pool.childType(child).toType(),
......@@ -3154,6 +3128,7 @@ pub const Type = struct {
31543128 .anon_struct_type => unreachable,
31553129
31563130 .ptr_type => unreachable,
3131 .anyframe_type => unreachable,
31573132 .array_type => unreachable,
31583133
31593134 .opt_type => unreachable,
......@@ -3327,7 +3302,6 @@ pub const Type = struct {
33273302 .error_set,
33283303 .error_set_merged,
33293304 .error_set_inferred,
3330 .anyframe_T,
33313305 .pointer,
33323306 => return null,
33333307
......@@ -3355,6 +3329,7 @@ pub const Type = struct {
33553329 .ptr_type,
33563330 .error_union_type,
33573331 .func_type,
3332 .anyframe_type,
33583333 => return null,
33593334
33603335 .array_type => |array_type| {
......@@ -3401,7 +3376,6 @@ pub const Type = struct {
34013376 .anyerror,
34023377 .comptime_int,
34033378 .comptime_float,
3404 .@"anyframe",
34053379 .enum_literal,
34063380 .atomic_order,
34073381 .atomic_rmw_op,
......@@ -3555,10 +3529,6 @@ pub const Type = struct {
35553529 },
35563530
35573531 .error_union => return ty.errorUnionPayload().comptimeOnly(mod),
3558 .anyframe_T => {
3559 const child_ty = ty.castTag(.anyframe_T).?.data;
3560 return child_ty.comptimeOnly(mod);
3561 },
35623532 },
35633533 else => switch (mod.intern_pool.indexToKey(ty.ip_index)) {
35643534 .int_type => false,
......@@ -3570,6 +3540,10 @@ pub const Type = struct {
35703540 return child_ty.comptimeOnly(mod);
35713541 }
35723542 },
3543 .anyframe_type => |child| {
3544 if (child == .none) return false;
3545 return child.toType().comptimeOnly(mod);
3546 },
35733547 .array_type => |array_type| array_type.child.toType().comptimeOnly(mod),
35743548 .vector_type => |vector_type| vector_type.child.toType().comptimeOnly(mod),
35753549 .opt_type => |child| child.toType().comptimeOnly(mod),
......@@ -3599,7 +3573,6 @@ pub const Type = struct {
35993573 .bool,
36003574 .void,
36013575 .anyerror,
3602 .@"anyframe",
36033576 .noreturn,
36043577 .generic_poison,
36053578 .atomic_order,
......@@ -4245,7 +4218,6 @@ pub const Type = struct {
42454218 pointer,
42464219 optional,
42474220 error_union,
4248 anyframe_T,
42494221 error_set,
42504222 error_set_single,
42514223 /// The type is the inferred error set of a specific function.
......@@ -4261,9 +4233,7 @@ pub const Type = struct {
42614233 .inferred_alloc_mut,
42624234 => @compileError("Type Tag " ++ @tagName(t) ++ " has no payload"),
42634235
4264 .optional,
4265 .anyframe_T,
4266 => Payload.ElemType,
4236 .optional => Payload.ElemType,
42674237
42684238 .error_set => Payload.ErrorSet,
42694239 .error_set_inferred => Payload.ErrorSetInferred,