# make \`@trap\` return unreachable/noreturn \(\#15749\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 3d64ed0353ba7ec1ca46f4779fe5d32af8d17358

Requested commit: 3d64ed0353ba7ec1ca46f4779fe5d32af8d17358

Commit: 3d64ed0353ba7ec1ca46f4779fe5d32af8d17358

Tree: 71f63ffcc5da6ea49c80d3aefa095b9178dac57b

Author: zooster

Committer: GitHub

## Message

```
make `@trap` return unreachable/noreturn (#15749)

`@trap` is a special function that we know never returns so it should
behave just like `@panic` and `@compileError` do currently and cause the
"unreachable code" + "control flow is diverted here" compile error.
Currently, `@trap(); @trap();` does not cause this error. Now it does.
```

## Parents

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

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