From 83991efe10d92c4b920d7b7fc75be98ed7854ad7 Mon Sep 17 00:00:00 2001 From: mlugg Date: Fri, 24 Jan 2025 02:19:28 +0000 Subject: 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 --- src/Zcu/PerThread.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Zcu') diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index c6a16ee00c..0529a7fb2a 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -605,7 +605,7 @@ pub fn ensureMemoizedStateUpToDate(pt: Zcu.PerThread, stage: InternPool.Memoized // We use an arbitrary element to check if the state has been resolved yet. const to_check: Zcu.BuiltinDecl = switch (stage) { .main => .Type, - .panic => .Panic, + .panic => .panic, .va_list => .VaList, }; if (zcu.builtin_decl_values.get(to_check) != .none) return; -- cgit v1.2.3