mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
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.
This commit is contained in:
parent
8b5c4baed8
commit
9b7b240c8e
@ -1150,9 +1150,10 @@ pub const panicInactiveUnionField = Panic.inactiveUnionField;
|
||||
/// To be deleted after zig1.wasm is updated.
|
||||
pub const panic_messages = Panic.messages;
|
||||
|
||||
pub noinline fn returnError(st: *StackTrace) void {
|
||||
pub noinline fn returnError() void {
|
||||
@branchHint(.unlikely);
|
||||
@setRuntimeSafety(false);
|
||||
const st = @errorReturnTrace().?;
|
||||
if (st.index < st.instruction_addresses.len)
|
||||
st.instruction_addresses[st.index] = @returnAddress();
|
||||
st.index += 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user