Skip to content

Commit 9b7b240

Browse files
mluggjacobly0
authored andcommitted
std.builtin: make returnError not take the error trace
It's now unnecessary to explicitly pass this, because it receives an implicit error trace parameter anyway, so can just use `@errorReturnTrace()`. The previous commit updated Sema to expect this new interface. This saves an AIR instruction at all `returnError` call sites.
1 parent 8b5c4ba commit 9b7b240

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/std/builtin.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,9 +1150,10 @@ pub const panicInactiveUnionField = Panic.inactiveUnionField;
11501150
/// To be deleted after zig1.wasm is updated.
11511151
pub const panic_messages = Panic.messages;
11521152

1153-
pub noinline fn returnError(st: *StackTrace) void {
1153+
pub noinline fn returnError() void {
11541154
@branchHint(.unlikely);
11551155
@setRuntimeSafety(false);
1156+
const st = @errorReturnTrace().?;
11561157
if (st.index < st.instruction_addresses.len)
11571158
st.instruction_addresses[st.index] = @returnAddress();
11581159
st.index += 1;

0 commit comments

Comments
 (0)