# stage2: improve handling of 0-bit types and arrays · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/0d4a94f32fc71f81d54db038f013854b8e9f0ac4)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 0d4a94f32fc71f81d54db038f013854b8e9f0ac4

Requested commit: 0d4a94f32fc71f81d54db038f013854b8e9f0ac4

Commit: 0d4a94f32fc71f81d54db038f013854b8e9f0ac4

Tree: 163668781596539d8d6f95e2de506aad544be355

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: improve handling of 0-bit types and arrays

 * Make `alloc` AIR instructions call `resolveTypeLayout`.
 * `Sema.zirResolveInferredAlloc` now calls `requireRuntimeBlock` in the
   case that it operates on a non-comptime instruction.
 * `Type.abiSize` and `Type.abiAlignment` now return 0 for `void`
 * Sema: implement `resolveTypeFields` for unions.
 * LLVM Backend: support `ptr_elem_ptr` when the element type is 0-bit.
 * Type: improve `abiAlignment` implementation for structs to properly
   handle fields with non-default alignment.
 * Value: implement hashing array, vector, and structs.

```

## Parents

- [b0f80ef0d5517b5ce8ba60dfae6dd986346f8d4c](https://git.cafe/gitcafe/zig/commit/b0f80ef0d5517b5ce8ba60dfae6dd986346f8d4c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/0d4a94f32fc71f81d54db038f013854b8e9f0ac4?format=markdown)
