# stage2: change \`@bitCast\` to always be by-value · gitcafe/zig

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

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

Visibility: public

Requested revision: 069c83d58cebba88275ee76ba01fabcd8e964573

Requested commit: 069c83d58cebba88275ee76ba01fabcd8e964573

Commit: 069c83d58cebba88275ee76ba01fabcd8e964573

Tree: ab7e52f307bd23869e2461189383522dc64f42de

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: change `@bitCast` to always be by-value

After a discussion about language specs, this seems like the best way to
go, because it's simpler to reason about both for humans and compilers.

The `bitcast_result_ptr` ZIR instruction is no longer needed.

This commit also implements writing enums, arrays, and vectors to
virtual memory at compile-time.

This unlocked some more of compiler-rt being able to build, which
in turn unlocks saturating arithmetic behavior tests.

There was also a memory leak in the comptime closure system which is now
fixed.

```

## Parents

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

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