| ... | ... | @@ -1886,11 +1886,8 @@ pub const Type = struct { |
| 1886 | 1886 | /// See also `isPtrLikeOptional`. |
| 1887 | 1887 | pub fn optionalReprIsPayload(ty: Type, mod: *const Module) bool { |
| 1888 | 1888 | return switch (mod.intern_pool.indexToKey(ty.toIntern())) { |
| 1889 | | .opt_type => |child_type| switch (mod.intern_pool.indexToKey(child_type)) { |
| 1890 | | .ptr_type => |ptr_type| switch (ptr_type.flags.size) { |
| 1891 | | .C => false, |
| 1892 | | .Slice, .Many, .One => !ptr_type.flags.is_allowzero, |
| 1893 | | }, |
| 1889 | .opt_type => |child_type| child_type == .anyerror_type or switch (mod.intern_pool.indexToKey(child_type)) { |
| 1890 | .ptr_type => |ptr_type| ptr_type.flags.size != .C and !ptr_type.flags.is_allowzero, |
| 1894 | 1891 | .error_set_type => true, |
| 1895 | 1892 | else => false, |
| 1896 | 1893 | }, |