From c85bae6d5f523a7bc86c7feea115214585e235b4 Mon Sep 17 00:00:00 2001 From: copygirl Date: Thu, 17 Aug 2023 16:14:59 +0200 Subject: [PATCH] Fix Trap not doing opaque correctly --- src/trap.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/trap.zig b/src/trap.zig index e88155f..0f29e33 100644 --- a/src/trap.zig +++ b/src/trap.zig @@ -76,14 +76,14 @@ pub const TrapCode = enum(u8) { } }; -pub const Trap = struct { +pub const Trap = opaque { /// Creates a new trap. /// The `Trap` returned is owned by the caller. - pub fn init(message: [:0]const u8) Trap { + pub fn init(message: [:0]const u8) *Trap { return wasmtime_trap_new(message.ptr, message.len + 1); } - pub fn copy(self: *const Trap) Trap { + pub fn copy(self: *const Trap) *Trap { return wasm_trap_copy(self); }