From af6b8ed095f88f1df2116cdc7a9d44872cfa6074 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 18 Apr 2024 07:39:07 +0200 Subject: Adding upstream version 0.26.0. Signed-off-by: Daniel Baumann --- tests/rust/forward_declaration.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/rust/forward_declaration.rs (limited to 'tests/rust/forward_declaration.rs') diff --git a/tests/rust/forward_declaration.rs b/tests/rust/forward_declaration.rs new file mode 100644 index 0000000..e97b63e --- /dev/null +++ b/tests/rust/forward_declaration.rs @@ -0,0 +1,21 @@ +#[repr(C)] +struct TypeInfo { + data: TypeData, +} + +#[repr(C)] +enum TypeData { + Primitive, + Struct(StructInfo), +} + +#[repr(C)] +struct StructInfo { + fields: *const *const TypeInfo, // requires forward declaration + num_fields: usize, +} + +#[no_mangle] +pub extern "C" fn root( + x: TypeInfo, +) {} -- cgit v1.2.3