| ... | @@ -932,7 +932,9 @@ pub fn abiAlignmentAdvanced( | ... | @@ -932,7 +932,9 @@ pub fn abiAlignmentAdvanced( |
| 932 | if (vector_type.len == 0) return .{ .scalar = .@"1" }; | 932 | if (vector_type.len == 0) return .{ .scalar = .@"1" }; |
| 933 | switch (mod.comp.getZigBackend()) { | 933 | switch (mod.comp.getZigBackend()) { |
| 934 | else => { | 934 | else => { |
| 935 | const elem_bits: u32 = @intCast(try Type.fromInterned(vector_type.child).bitSizeAdvanced(pt, .sema)); | 935 | // This is fine because the child type of a vector always has a bit-size known |
| | 936 | // without needing any type resolution. |
| | 937 | const elem_bits: u32 = @intCast(Type.fromInterned(vector_type.child).bitSize(pt)); |
| 936 | if (elem_bits == 0) return .{ .scalar = .@"1" }; | 938 | if (elem_bits == 0) return .{ .scalar = .@"1" }; |
| 937 | const bytes = ((elem_bits * vector_type.len) + 7) / 8; | 939 | const bytes = ((elem_bits * vector_type.len) + 7) / 8; |
| 938 | const alignment = std.math.ceilPowerOfTwoAssert(u32, bytes); | 940 | const alignment = std.math.ceilPowerOfTwoAssert(u32, bytes); |
| ... | @@ -2829,7 +2831,8 @@ pub fn comptimeOnlyAdvanced(ty: Type, pt: Zcu.PerThread, comptime strat: Resolve | ... | @@ -2829,7 +2831,8 @@ pub fn comptimeOnlyAdvanced(ty: Type, pt: Zcu.PerThread, comptime strat: Resolve |
| 2829 | .no, .wip => false, | 2831 | .no, .wip => false, |
| 2830 | .yes => true, | 2832 | .yes => true, |
| 2831 | .unknown => { | 2833 | .unknown => { |
| 2832 | assert(strat == .sema); | 2834 | // Inlined `assert` so that the resolution calls below are not statically reachable. |
| | 2835 | if (strat != .sema) unreachable; |
| 2833 | | 2836 | |
| 2834 | if (struct_type.flagsUnordered(ip).field_types_wip) { | 2837 | if (struct_type.flagsUnordered(ip).field_types_wip) { |
| 2835 | struct_type.setRequiresComptime(ip, .unknown); | 2838 | struct_type.setRequiresComptime(ip, .unknown); |
| ... | @@ -2874,7 +2877,8 @@ pub fn comptimeOnlyAdvanced(ty: Type, pt: Zcu.PerThread, comptime strat: Resolve | ... | @@ -2874,7 +2877,8 @@ pub fn comptimeOnlyAdvanced(ty: Type, pt: Zcu.PerThread, comptime strat: Resolve |
| 2874 | .no, .wip => return false, | 2877 | .no, .wip => return false, |
| 2875 | .yes => return true, | 2878 | .yes => return true, |
| 2876 | .unknown => { | 2879 | .unknown => { |
| 2877 | assert(strat == .sema); | 2880 | // Inlined `assert` so that the resolution calls below are not statically reachable. |
| | 2881 | if (strat != .sema) unreachable; |
| 2878 | | 2882 | |
| 2879 | if (union_type.flagsUnordered(ip).status == .field_types_wip) { | 2883 | if (union_type.flagsUnordered(ip).status == .field_types_wip) { |
| 2880 | union_type.setRequiresComptime(ip, .unknown); | 2884 | union_type.setRequiresComptime(ip, .unknown); |