aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2025-01-24 02:19:28 +0000
committermlugg <mlugg@mlugg.co.uk>2025-01-24 19:29:51 +0000
commit83991efe10d92c4b920d7b7fc75be98ed7854ad7 (patch)
tree7137ee5eb01517aede1c5503c29a2003fca71f80 /src/main.zig
parentb3d9b0e3f6bab5d662ec385cf754872f8a90607f (diff)
downloadzig-83991efe10d92c4b920d7b7fc75be98ed7854ad7.tar.gz
zig-83991efe10d92c4b920d7b7fc75be98ed7854ad7.zip
compiler: yet more panic handler changes
* `std.builtin.Panic` -> `std.builtin.panic`, because it is a namespace. * `root.Panic` -> `root.panic` for the same reason. There are type checks so that we still allow the legacy `pub fn panic` strategy in the 0.14.0 release. * `std.debug.SimplePanic` -> `std.debug.simple_panic`, same reason. * `std.debug.NoPanic` -> `std.debug.no_panic`, same reason. * `std.debug.FormattedPanic` is now a function `std.debug.FullPanic` which takes as input a `panicFn` and returns a namespace with all the panic functions. This handles the incredibly common case of just wanting to override how the message is printed, whilst keeping nice formatted panics. * Remove `std.builtin.panic.messages`; now, every safety panic has its own function. This reduces binary bloat, as calls to these functions no longer need to prepare any arguments (aside from the error return trace). * Remove some legacy declarations, since a zig1.wasm update has happened. Most of these were related to the panic handler, but a quick grep for "zig1" brought up a couple more results too. Also, add some missing type checks to Sema. Resolves: #22584 formatted -> full
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig
index ae7c2229aa..5d691060c6 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -56,7 +56,7 @@ pub const std_options: std.Options = .{
},
};
-pub const Panic = crash_report.Panic;
+pub const panic = crash_report.panic;
var wasi_preopens: fs.wasi.Preopens = undefined;
pub fn wasi_cwd() std.os.wasi.fd_t {