# stage2: more debuggable panics · gitcafe/zig

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

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

Visibility: public

Requested revision: c7dc451a2a06a0ade0bb44a48cb6e5cde6e237df

Requested commit: c7dc451a2a06a0ade0bb44a48cb6e5cde6e237df

Commit: c7dc451a2a06a0ade0bb44a48cb6e5cde6e237df

Tree: 2b3f5e06da3918326b61eeb4f10a11d8cf7668ed

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: more debuggable panics

For now these errors are handled via `@panic` rather than `unreachable`.
These are relatively likely bugs to occur at this early stage of
development, and handling them as panics lets us ship release builds
of the compiler without worrying about undefined behavior.

Furthermore, in stage1, `@panic` is implemented to include an error
return trace, while `unreachable` is not. In this case, the error return
traces are extremely helpful in debugging the compiler.

```

## Parents

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

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