| author | |
| committer | |
| log | b802a67562cc912213ebfc6ef8a380c775c999fe |
| tree | e08cd738c97b67c440904dfb141076c6ad334159 |
| parent | bb0e28a54ff60581c30156707eeeba1a6bd2b28f |
Ever since a semi-recent language specification update, pointers to
zero-sized types still have runtime bits.1 files changed, 4 insertions(+), 1 deletions(-)
lib/std/multi_array_list.zig+4-1| ... | ... | @@ -42,7 +42,10 @@ pub fn MultiArrayList(comptime S: type) type { |
| 42 | 42 | return &[_]F{}; |
| 43 | 43 | } |
| 44 | 44 | const byte_ptr = self.ptrs[@enumToInt(field)]; |
| 45 | const casted_ptr: [*]F = if (@sizeOf([*]F) == 0) undefined else @ptrCast([*]F, @alignCast(@alignOf(F), byte_ptr)); | |
| 45 | const casted_ptr: [*]F = if (@sizeOf(F) == 0) | |
| 46 | undefined | |
| 47 | else | |
| 48 | @ptrCast([*]F, @alignCast(@alignOf(F), byte_ptr)); | |
| 46 | 49 | return casted_ptr[0..self.len]; |
| 47 | 50 | } |
| 48 | 51 |