# move types from builtin to std · gitcafe/zig

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

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

Visibility: public

Requested revision: 17eb24a7e4b2bc5740dc15996acc4736833cb2a0

Requested commit: 17eb24a7e4b2bc5740dc15996acc4736833cb2a0

Commit: 17eb24a7e4b2bc5740dc15996acc4736833cb2a0

Tree: 7568873daeb3667768cee4a083a49acac2b53149

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
move types from builtin to std

 * All the data types from `@import("builtin")` are moved to
  `@import("std").builtin`. The target-related types are moved
  to `std.Target`. This allows the data types to have methods, such as
  `std.Target.current.isDarwin()`.
 * `std.os.windows.subsystem` is moved to
   `std.Target.current.subsystem`.
 * Remove the concept of the panic package from the compiler
   implementation. Instead, `std.builtin.panic` is always the panic
   function. It checks for `@hasDecl(@import("root"), "panic")`,
   or else provides a default implementation.

This is an important step for multibuilds (#3028). Without this change,
the types inside the builtin namespace look like different types, when
trying to merge builds with different target settings. With this change,
Zig can figure out that, e.g., `std.builtin.Os` (the enum type) from one
compilation and `std.builtin.Os` from another compilation are the same
type, even if the target OS value differs.

```

## Parents

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

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