From 9e2fbe7f00e5e014c6c4c12d6c130a17a999f7d9 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 1 Nov 2025 09:24:33 -0700 Subject: [PATCH] Fix defining fields of forward-declared structures This fixes a typo in the bindings generation script which set the `_fields` field rather than `_fields_` --- ci/cbindgen.py | 2 +- wasmtime/_bindings.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/cbindgen.py b/ci/cbindgen.py index 27f68e0d..4c2188ed 100644 --- a/ci/cbindgen.py +++ b/ci/cbindgen.py @@ -53,7 +53,7 @@ def visit_Struct(self, node): decl.name = '_anon_' + str(anon_decl) if node.name in self.forward_declared: - self.ret += "{}._fields = [ # type: ignore\n".format(node.name) + self.ret += "{}._fields_ = [\n".format(node.name) else: self.ret += "class {}(Structure):\n".format(node.name) self.ret += " _fields_ = [\n" diff --git a/wasmtime/_bindings.py b/wasmtime/_bindings.py index a9218a00..64b8d6c4 100644 --- a/wasmtime/_bindings.py +++ b/wasmtime/_bindings.py @@ -3942,14 +3942,14 @@ class wasmtime_component_valunion(Union): wasmtime_component_valunion_t = wasmtime_component_valunion -wasmtime_component_val._fields = [ # type: ignore +wasmtime_component_val._fields_ = [ ("kind", wasmtime_component_valkind_t), ("of", wasmtime_component_valunion_t), ] wasmtime_component_val_t = wasmtime_component_val -wasmtime_component_valrecord_entry._fields = [ # type: ignore +wasmtime_component_valrecord_entry._fields_ = [ ("name", wasm_name_t), ("val", wasmtime_component_val_t), ]